Changeset 17646 in vbox for trunk/include/VBox/com
- Timestamp:
- Mar 10, 2009 5:47:31 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 44134
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/string.h
r17634 r17646 409 409 } 410 410 411 void append(const Utf8Str &that) 412 { 413 size_t cbThis = length(); 414 size_t cbThat = that.length(); 415 416 if (cbThat) 417 { 418 size_t cbBoth = cbThis + cbThat + 1; 419 420 // @todo optimize 421 char *pszTemp; 422 #if !defined (VBOX_WITH_XPCOM) 423 pszTemp = (char*)::RTMemTmpAlloc(cbBoth); 424 #else 425 pszTemp = (char*)nsMemory::Alloc(cbBoth); 426 #endif 427 if (str) 428 { 429 memcpy(pszTemp, str, cbThis); 430 setNull(); 431 } 432 if (that.str) 433 memcpy(pszTemp + cbThis, that.str, cbThat); 434 pszTemp[cbThis + cbThat] = '\0'; 435 436 str = pszTemp; 437 } 438 } 439 411 440 int compare (const char *s) const 412 441 {
Note:
See TracChangeset
for help on using the changeset viewer.