Changeset 30750 in vbox for trunk/include/VBox/com
- Timestamp:
- Jul 8, 2010 6:40:30 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63527
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/string.h
r28800 r30750 552 552 protected: 553 553 554 /** 555 * As with the ministring::copyFrom() variants, this unconditionally 556 * sets the members to a copy of the given other strings and makes 557 * no assumptions about previous contents. This can therefore be used 558 * both in copy constructors, when member variables have no defined 559 * value, and in assignments after having called cleanup(). 560 * 561 * This variant converts from a UTF-16 string, most probably from 562 * a Bstr assignment. 563 * 564 * @param rs 565 */ 566 void copyFrom(CBSTR s) 567 { 568 if (s && *s) 569 { 570 RTUtf16ToUtf8((PRTUTF16)s, &m_psz); /** @todo r=bird: This isn't throwing std::bad_alloc / handling return codes. 571 * Also, this technically requires using RTStrFree, ministring::cleanup() uses RTMemFree. */ 572 m_cbLength = strlen(m_psz); /** @todo optimize by using a different RTUtf* function */ 573 m_cbAllocated = m_cbLength + 1; 574 } 575 else 576 { 577 m_cbLength = 0; 578 m_cbAllocated = 0; 579 m_psz = NULL; 580 } 581 } 554 void copyFrom(CBSTR s); 582 555 583 556 friend class Bstr; /* to access our raw_copy() */ … … 614 587 615 588 protected: 616 617 Utf8StrFmt() {}589 Utf8StrFmt() 590 { } 618 591 619 592 void init(const char *format, va_list args); 620 593 621 594 private: 622 623 static DECLCALLBACK(size_t) strOutput(void *pvArg, const char *pachChars,624 size_t cbChars);625 595 }; 626 596
Note:
See TracChangeset
for help on using the changeset viewer.