Changeset 24657 in vbox for trunk/include/VBox/com
- Timestamp:
- Nov 14, 2009 10:46:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/string.h
r23908 r24657 375 375 376 376 /** 377 * Intended to assign instances to |char *| out parameters from within the 378 * interface method. Transfers the ownership of the duplicated string to the 379 * caller. 377 * Intended to assign instances to |char *| out parameters from within the 378 * interface method. Transfers the ownership of the duplicated string to the 379 * caller. 380 * 381 * @remarks The returned string must be freed by RTStrFree, not RTMemFree. 380 382 */ 381 383 const Utf8Str& cloneTo(char **pstr) const 382 384 { 383 if (pstr) 385 if (pstr) /** @todo r=bird: This needs to if m_psz is NULL. Shouldn't it also throw std::bad_alloc? */ 384 386 *pstr = RTStrDup(m_psz); 385 387 return *this; … … 471 473 472 474 /** 473 * Intended to pass instances as out (|char **|) parameters to methods. 474 * Takes the ownership of the returned data. 475 * Intended to pass instances as out (|char **|) parameters to methods. Takes 476 * the ownership of the returned data. 477 * 478 * @remarks See ministring::jolt(). 475 479 */ 476 480 char **asOutParam() … … 503 507 if (s) 504 508 { 505 RTUtf16ToUtf8((PRTUTF16)s, &m_psz); 506 m_cbLength = strlen(m_psz); // TODO optimize by using a different RTUtf* function 509 RTUtf16ToUtf8((PRTUTF16)s, &m_psz); /** @todo r=bird: This isn't throwing std::bad_alloc / handling return codes. 510 * Also, this technically requires using RTStrFree, ministring::cleanup() uses RTMemFree. */ 511 m_cbLength = strlen(m_psz); /** @todo optimize by using a different RTUtf* function */ 507 512 m_cbAllocated = m_cbLength + 1; 508 513 } … … 676 681 } /* namespace com */ 677 682 678 #endif /* ___VBox_com_string_h */ 683 #endif /* !___VBox_com_string_h */ 684
Note:
See TracChangeset
for help on using the changeset viewer.