Changeset 32727 in vbox for trunk/include/VBox/com
- Timestamp:
- Sep 23, 2010 2:31:31 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 66161
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/string.h
r32718 r32727 7 7 8 8 /* 9 * Copyright (C) 2006-20 09Oracle Corporation9 * Copyright (C) 2006-2010 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 38 38 #endif 39 39 40 #if defined 40 #if defined(VBOX_WITH_XPCOM) 41 41 # include <nsMemory.h> 42 42 #endif … … 107 107 } 108 108 109 #if defined 109 #if defined(VBOX_WITH_XPCOM) 110 110 Bstr(const wchar_t *that) 111 111 { … … 144 144 } 145 145 146 #if defined 146 #if defined(VBOX_WITH_XPCOM) 147 147 Bstr& operator=(const wchar_t *that) 148 148 { … … 212 212 size_t length() const { return isEmpty() ? 0 : ::RTUtf16Len((PRTUTF16)m_bstr); } 213 213 214 #if defined(VBOX_WITH_XPCOM) 214 215 /** 215 216 * Returns a pointer to the raw member UTF-16 string. If the member string is empty, … … 224 225 return g_bstrEmpty; 225 226 } 227 #else 228 /** 229 * Windows-only hack, as the automatically generated headers use BSTR. 230 * So if we don't want to cast like crazy we have to be more loose than 231 * on XPCOM. 232 * 233 * Returns a pointer to the raw member UTF-16 string. If the member string is empty, 234 * returns a pointer to a global variable containing an empty BSTR with a proper zero 235 * length prefix so that Windows is happy. 236 */ 237 BSTR raw() const 238 { 239 if (m_bstr) 240 return m_bstr; 241 242 return g_bstrEmpty; 243 } 244 #endif 226 245 227 246 /** … … 438 457 } 439 458 440 #if defined 459 #if defined(VBOX_WITH_XPCOM) 441 460 /** 442 461 * Intended to assign instances to |char *| out parameters from within the … … 537 556 * The usage of this class is like the following: 538 557 * <code> 539 * Utf8StrFmt string 558 * Utf8StrFmt string("program name = %s", argv[0]); 540 559 * </code> 541 560 */
Note:
See TracChangeset
for help on using the changeset viewer.