Changeset 19239 in vbox for trunk/include/VBox/com
- Timestamp:
- Apr 28, 2009 1:19:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/Guid.h
r15959 r19239 78 78 } 79 79 80 Guid (const Bstr &that) 81 { 82 ::RTUuidClear (&uuid); 83 if (!that.isNull()) 84 ::RTUuidFromUtf16(&uuid, that.raw()); 85 } 86 80 87 Guid &operator= (const Guid &that) 81 88 { … … 107 114 ::RTUuidToStr (&uuid, buf, RTUUID_STR_LENGTH); 108 115 return Utf8Str (buf); 116 } 117 118 Bstr toUtf16 () const 119 { 120 if (isEmpty()) 121 return Bstr(); 122 123 RTUTF16 buf [RTUUID_STR_LENGTH]; 124 ::RTUuidToUtf16 (&uuid, buf, RTUUID_STR_LENGTH); 125 return Bstr (buf); 109 126 } 110 127 … … 192 209 }; 193 210 211 inline Bstr asGuidStr(const Bstr& str) 212 { 213 Guid guid(str); 214 return guid.isEmpty() ? Bstr() : guid.toUtf16(); 215 } 216 217 inline bool isValidGuid(const Bstr& str) 218 { 219 Guid guid(str); 220 return !guid.isEmpty(); 221 } 222 223 194 224 /* work around error C2593 of the stupid MSVC 7.x ambiguity resolver */ 195 225 WORKAROUND_MSVC7_ERROR_C2593_FOR_BOOL_OP (Guid)
Note:
See TracChangeset
for help on using the changeset viewer.