Changeset 86959 in vbox for trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp
- Timestamp:
- Nov 23, 2020 11:25:53 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp
r86889 r86959 1128 1128 return "Unknown"; 1129 1129 } 1130 1131 /** 1132 * Converts Shared Clipboard formats to a string. 1133 * 1134 * @returns Stringified Shared Clipboard formats, or NULL on failure. Must be free'd with RTStrFree(). 1135 * @param fFormats Shared Clipboard formats to convert. 1136 * 1137 */ 1138 char *ShClFormatsToStrA(SHCLFORMATS fFormats) 1139 { 1140 #define APPEND_FMT_TO_STR(_aFmt) \ 1141 if (fFormats & VBOX_SHCL_FMT_##_aFmt) \ 1142 { \ 1143 if (pszFmts) \ 1144 { \ 1145 rc2 = RTStrAAppend(&pszFmts, ", "); \ 1146 if (RT_FAILURE(rc2)) \ 1147 break; \ 1148 } \ 1149 \ 1150 rc2 = RTStrAAppend(&pszFmts, #_aFmt); \ 1151 if (RT_FAILURE(rc2)) \ 1152 break; \ 1153 } 1154 1155 char *pszFmts = NULL; 1156 int rc2 = VINF_SUCCESS; 1157 1158 do 1159 { 1160 APPEND_FMT_TO_STR(UNICODETEXT); 1161 APPEND_FMT_TO_STR(BITMAP); 1162 APPEND_FMT_TO_STR(HTML); 1163 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1164 APPEND_FMT_TO_STR(URI_LIST); 1165 # endif 1166 1167 } while (0); 1168 1169 if (!pszFmts) 1170 rc2 = RTStrAAppend(&pszFmts, "NONE"); 1171 1172 if ( RT_FAILURE(rc2) 1173 && pszFmts) 1174 { 1175 RTStrFree(pszFmts); 1176 pszFmts = NULL; 1177 } 1178 1179 #undef APPEND_FMT_TO_STR 1180 1181 return pszFmts; 1182 } 1183
Note:
See TracChangeset
for help on using the changeset viewer.