Changeset 36527 in vbox
- Timestamp:
- Apr 4, 2011 1:16:09 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70949
- Location:
- trunk
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/string.h
r36429 r36527 72 72 * 73 73 * The Bstr class hides all this handling behind a std::string-like interface 74 * and also provides automatic conversions to MiniString and Utf8Str instances.74 * and also provides automatic conversions to RTCString and Utf8Str instances. 75 75 * 76 76 * The one advantage of using the SysString* routines is that this makes it … … 117 117 #endif 118 118 119 Bstr(const iprt::MiniString &that)119 Bstr(const RTCString &that) 120 120 { 121 121 copyFrom(that.c_str()); … … 426 426 * String class used universally in Main for UTF-8 strings. 427 427 * 428 * This is based on iprt::MiniString, to which some functionality has been428 * This is based on RTCString, to which some functionality has been 429 429 * moved. Here we keep things that are specific to Main, such as conversions 430 430 * with UTF-16 strings (Bstr). 431 431 * 432 * Like iprt::MiniString, Utf8Str does not differentiate between NULL strings432 * Like RTCString, Utf8Str does not differentiate between NULL strings 433 433 * and empty strings. In other words, Utf8Str("") and Utf8Str(NULL) behave the 434 * same. In both cases, MiniString allocates no memory, reports434 * same. In both cases, RTCString allocates no memory, reports 435 435 * a zero length and zero allocated bytes for both, and returns an empty 436 436 * C string from c_str(). … … 440 440 * from external sources before passing them to Utf8Str or Bstr. 441 441 */ 442 class Utf8Str : public iprt::MiniString442 class Utf8Str : public RTCString 443 443 { 444 444 public: … … 446 446 Utf8Str() {} 447 447 448 Utf8Str(const MiniString &that)449 : MiniString(that)448 Utf8Str(const RTCString &that) 449 : RTCString(that) 450 450 {} 451 451 452 452 Utf8Str(const char *that) 453 : MiniString(that)453 : RTCString(that) 454 454 {} 455 455 … … 472 472 * @param a_va Argument vector containing the arguments 473 473 * specified by the format string. 474 * @sa iprt::MiniString::printfV474 * @sa RTCString::printfV 475 475 */ 476 476 Utf8Str(const char *a_pszFormat, va_list a_va) 477 : MiniString(a_pszFormat, a_va)478 { 479 } 480 481 Utf8Str& operator=(const MiniString &that)482 { 483 MiniString::operator=(that);477 : RTCString(a_pszFormat, a_va) 478 { 479 } 480 481 Utf8Str& operator=(const RTCString &that) 482 { 483 RTCString::operator=(that); 484 484 return *this; 485 485 } … … 487 487 Utf8Str& operator=(const char *that) 488 488 { 489 MiniString::operator=(that);489 RTCString::operator=(that); 490 490 return *this; 491 491 } … … 572 572 573 573 /** 574 * Class with iprt::MiniString::printf as constructor for your convenience.574 * Class with RTCString::printf as constructor for your convenience. 575 575 * 576 576 * Constructing a Utf8Str string object from a format string and a variable -
trunk/include/iprt/cpp/exception.h
r36523 r36527 49 49 } 50 50 51 RTCError(const iprt::MiniString &a_rstrMessage)51 RTCError(const RTCString &a_rstrMessage) 52 52 : m_strMsg(a_rstrMessage) 53 53 { … … 87 87 88 88 /** The exception message. */ 89 iprt::MiniString m_strMsg;89 RTCString m_strMsg; 90 90 }; 91 91 -
trunk/include/iprt/cpp/list.h
r36526 r36527 54 54 * preallocated. To minimize the memory overhead, native types (that is 55 55 * everything smaller then the size of void*) are directly saved in the array. 56 * If bigger types are used (e.g. iprt::MiniString) the internal array is an57 * array ofpointers to the objects.56 * If bigger types are used (e.g. RTCString) the internal array is an array of 57 * pointers to the objects. 58 58 * 59 59 * The size of the internal array will usually not shrink, but grow -
trunk/include/iprt/cpp/ministring.h
r36508 r36527 1 1 /** @file 2 * IPRT - MiniC++ string class.2 * IPRT - C++ string class. 3 3 */ 4 4 … … 24 24 */ 25 25 26 #ifndef ___ VBox_ministring_h27 #define ___ VBox_ministring_h26 #ifndef ___iprt_cpp_ministring_h 27 #define ___iprt_cpp_ministring_h 28 28 29 29 #include <iprt/mem.h> … … 34 34 #include <new> 35 35 36 namespace iprt37 {38 36 39 37 /** @defgroup grp_rt_cpp_string C++ String support … … 42 40 */ 43 41 44 /** @brief MiniC++ string class.45 * 46 * "MiniString" is a small C++ string class that does not depend on anything47 * else except IPRT memory management functions. Semantics are like in48 * std::string, except itcan do a lot less.49 * 50 * Note that MiniString does not differentiate between NULL strings and51 * empty strings. In other words, MiniString("") and MiniString(NULL)52 * behave the same. In both cases, MiniString allocates no memory, reports42 /** @brief C++ string class. 43 * 44 * This is a C++ string class that does not depend on anything else except IPRT 45 * memory management functions. Semantics are like in std::string, except it 46 * can do a lot less. 47 * 48 * Note that RTCString does not differentiate between NULL strings 49 * and empty strings. In other words, RTCString("") and RTCString(NULL) 50 * behave the same. In both cases, RTCString allocates no memory, reports 53 51 * a zero length and zero allocated bytes for both, and returns an empty 54 52 * C string from c_str(). 55 53 * 56 * @note MiniString ASSUMES that all strings it deals with are valid UTF-8.54 * @note RTCString ASSUMES that all strings it deals with are valid UTF-8. 57 55 * The caller is responsible for not breaking this assumption. 58 56 */ 59 57 #ifdef VBOX 60 58 /** @remarks Much of the code in here used to be in com::Utf8Str so that 61 * com::Utf8Str can now derive from MiniString and only contain code59 * com::Utf8Str can now derive from RTCString and only contain code 62 60 * that is COM-specific, such as com::Bstr conversions. Compared to 63 * the old Utf8Str though, MiniString always knows the length of its61 * the old Utf8Str though, RTCString always knows the length of its 64 62 * member string and the size of the buffer so it can use memcpy() 65 63 * instead of strdup(). 66 64 */ 67 65 #endif 68 class RT_DECL_CLASS MiniString66 class RT_DECL_CLASS RTCString 69 67 { 70 68 public: … … 72 70 * Creates an empty string that has no memory allocated. 73 71 */ 74 MiniString()72 RTCString() 75 73 : m_psz(NULL), 76 74 m_cch(0), … … 80 78 81 79 /** 82 * Creates a copy of another MiniString.80 * Creates a copy of another RTCString. 83 81 * 84 82 * This allocates s.length() + 1 bytes for the new instance, unless s is empty. … … 88 86 * @throws std::bad_alloc 89 87 */ 90 MiniString(const MiniString &a_rSrc)88 RTCString(const RTCString &a_rSrc) 91 89 { 92 90 copyFromN(a_rSrc.m_psz, a_rSrc.m_cch); … … 102 100 * @throws std::bad_alloc 103 101 */ 104 MiniString(const char *pcsz)102 RTCString(const char *pcsz) 105 103 { 106 104 copyFromN(pcsz, pcsz ? strlen(pcsz) : 0); … … 108 106 109 107 /** 110 * Create a partial copy of another MiniString.108 * Create a partial copy of another RTCString. 111 109 * 112 110 * @param a_rSrc The source string. … … 115 113 * to copy from the source string. 116 114 */ 117 MiniString(const MiniString &a_rSrc, size_t a_offSrc, size_t a_cchSrc = npos)115 RTCString(const RTCString &a_rSrc, size_t a_offSrc, size_t a_cchSrc = npos) 118 116 { 119 117 if (a_offSrc < a_rSrc.m_cch) … … 136 134 * that for the va_list constructor. 137 135 */ 138 MiniString(const char *a_pszSrc, size_t a_cchSrc)136 RTCString(const char *a_pszSrc, size_t a_cchSrc) 139 137 { 140 138 size_t cchMax = a_pszSrc ? RTStrNLen(a_pszSrc, a_cchSrc) : 0; … … 149 147 * @param a_ch The character to fill the string with. 150 148 */ 151 MiniString(size_t a_cTimes, char a_ch)149 RTCString(size_t a_cTimes, char a_ch) 152 150 : m_psz(NULL), 153 151 m_cch(0), … … 174 172 * @remarks Not part of std::string. 175 173 */ 176 MiniString(const char *a_pszFormat, va_list a_va)174 RTCString(const char *a_pszFormat, va_list a_va) 177 175 : m_psz(NULL), 178 176 m_cch(0), … … 185 183 * Destructor. 186 184 */ 187 virtual ~ MiniString()185 virtual ~RTCString() 188 186 { 189 187 cleanup(); … … 280 278 * @returns Reference to the object. 281 279 */ 282 MiniString &operator=(const char *pcsz)280 RTCString &operator=(const char *pcsz) 283 281 { 284 282 if (m_psz != pcsz) … … 300 298 * @returns Reference to the object. 301 299 */ 302 MiniString &operator=(const MiniString &s)300 RTCString &operator=(const RTCString &s) 303 301 { 304 302 if (this != &s) … … 322 320 * @returns Reference to the object. 323 321 */ 324 MiniString &printf(const char *pszFormat, ...);322 RTCString &printf(const char *pszFormat, ...); 325 323 326 324 /** … … 336 334 * @returns Reference to the object. 337 335 */ 338 MiniString &printfV(const char *pszFormat, va_list va);336 RTCString &printfV(const char *pszFormat, va_list va); 339 337 340 338 /** … … 347 345 * @returns Reference to the object. 348 346 */ 349 MiniString &append(const MiniString &that);347 RTCString &append(const RTCString &that); 350 348 351 349 /** … … 358 356 * @returns Reference to the object. 359 357 */ 360 MiniString &append(const char *pszThat);358 RTCString &append(const char *pszThat); 361 359 362 360 /** … … 369 367 * @returns Reference to the object. 370 368 */ 371 MiniString &append(char ch);369 RTCString &append(char ch); 372 370 373 371 /** … … 380 378 * @returns Reference to the object. 381 379 */ 382 MiniString &appendCodePoint(RTUNICP uc);383 384 /** 385 * Shortcut to append(), MiniString variant.380 RTCString &appendCodePoint(RTUNICP uc); 381 382 /** 383 * Shortcut to append(), RTCString variant. 386 384 * 387 385 * @param that The string to append. … … 389 387 * @returns Reference to the object. 390 388 */ 391 MiniString &operator+=(const MiniString &that)389 RTCString &operator+=(const RTCString &that) 392 390 { 393 391 return append(that); … … 401 399 * @returns Reference to the object. 402 400 */ 403 MiniString &operator+=(const char *pszThat)401 RTCString &operator+=(const char *pszThat) 404 402 { 405 403 return append(pszThat); … … 413 411 * @returns Reference to the object. 414 412 */ 415 MiniString &operator+=(char c)413 RTCString &operator+=(char c) 416 414 { 417 415 return append(c); … … 423 421 * @returns Reference to the object. 424 422 */ 425 MiniString &toUpper()423 RTCString &toUpper() 426 424 { 427 425 if (length()) … … 442 440 * @returns Reference to the object. 443 441 */ 444 MiniString &toLower()442 RTCString &toLower() 445 443 { 446 444 if (length()) … … 494 492 * capacity() to find out how large that buffer is. 495 493 * -# After any operation that modifies the length of the string, 496 * you _must_ call MiniString::jolt(), or subsequent copy operations494 * you _must_ call RTCString::jolt(), or subsequent copy operations 497 495 * may go nowhere. Better not use mutableRaw() at all. 498 496 */ … … 582 580 583 581 /** 584 * Compares the member string to another MiniString.582 * Compares the member string to another RTCString. 585 583 * 586 584 * @param pcszThat The string to compare with. … … 589 587 * if larger. 590 588 */ 591 int compare(const MiniString &that, CaseSensitivity cs = CaseSensitive) const589 int compare(const RTCString &that, CaseSensitivity cs = CaseSensitive) const 592 590 { 593 591 if (cs == CaseSensitive) … … 602 600 * @param that The string to compare with. 603 601 */ 604 bool equals(const MiniString &that) const602 bool equals(const RTCString &that) const 605 603 { 606 604 return that.length() == length() … … 629 627 * @param that The string to compare with. 630 628 */ 631 bool equalsIgnoreCase(const MiniString &that) const629 bool equalsIgnoreCase(const RTCString &that) const 632 630 { 633 631 /* Unfolded upper and lower case characters may require different … … 653 651 /** @name Comparison operators. 654 652 * @{ */ 655 bool operator==(const MiniString &that) const { return equals(that); }656 bool operator!=(const MiniString &that) const { return !equals(that); }657 bool operator<( const MiniString &that) const { return compare(that) < 0; }658 bool operator>( const MiniString &that) const { return compare(that) > 0; }653 bool operator==(const RTCString &that) const { return equals(that); } 654 bool operator!=(const RTCString &that) const { return !equals(that); } 655 bool operator<( const RTCString &that) const { return compare(that) < 0; } 656 bool operator>( const RTCString &that) const { return compare(that) > 0; } 659 657 660 658 bool operator==(const char *pszThat) const { return equals(pszThat); } … … 709 707 * n bytes have been copied. 710 708 */ 711 iprt::MiniString substr(size_t pos = 0, size_t n = npos) const712 { 713 return MiniString(*this, pos, n);709 RTCString substr(size_t pos = 0, size_t n = npos) const 710 { 711 return RTCString(*this, pos, n); 714 712 } 715 713 … … 725 723 * been copied. 726 724 */ 727 iprt::MiniString substrCP(size_t pos = 0, size_t n = npos) const;725 RTCString substrCP(size_t pos = 0, size_t n = npos) const; 728 726 729 727 /** … … 734 732 * @returns true if match, false if mismatch. 735 733 */ 736 bool endsWith(const iprt::MiniString &that, CaseSensitivity cs = CaseSensitive) const;734 bool endsWith(const RTCString &that, CaseSensitivity cs = CaseSensitive) const; 737 735 738 736 /** … … 742 740 * @returns true if match, false if mismatch. 743 741 */ 744 bool startsWith(const iprt::MiniString &that, CaseSensitivity cs = CaseSensitive) const;742 bool startsWith(const RTCString &that, CaseSensitivity cs = CaseSensitive) const; 745 743 746 744 /** … … 751 749 * @returns true if match, false if mismatch. 752 750 */ 753 bool contains(const iprt::MiniString &that, CaseSensitivity cs = CaseSensitive) const;751 bool contains(const RTCString &that, CaseSensitivity cs = CaseSensitive) const; 754 752 755 753 /** … … 827 825 * @returns separated strings as string list. 828 826 */ 829 iprt::list< iprt::MiniString, iprt::MiniString *> split(const iprt::MiniString &a_rstrSep,830 827 iprt::list<RTCString, RTCString *> split(const RTCString &a_rstrSep, 828 SplitMode a_enmMode = RemoveEmptyParts); 831 829 832 830 /** … … 837 835 * @returns joined string. 838 836 */ 839 static iprt::MiniString join(const iprt::list<iprt::MiniString, iprt::MiniString *> &a_rList,840 const iprt::MiniString &a_rstrSep = "");837 static RTCString join(const iprt::list<RTCString, RTCString *> &a_rList, 838 const RTCString &a_rstrSep = ""); 841 839 842 840 protected: … … 917 915 /** @} */ 918 916 919 } /* namespace iprt */920 917 921 918 /** @addtogroup grp_rt_cpp_string … … 930 927 * @returns the concatenate string. 931 928 * 932 * @relates iprt::MiniString929 * @relates RTCString 933 930 */ 934 RTDECL(const iprt::MiniString) operator+(const iprt::MiniString &a_rstr1, const iprt::MiniString &a_rstr2);931 RTDECL(const RTCString) operator+(const RTCString &a_rstr1, const RTCString &a_rstr2); 935 932 936 933 /** … … 941 938 * @returns the concatenate string. 942 939 * 943 * @relates iprt::MiniString940 * @relates RTCString 944 941 */ 945 RTDECL(const iprt::MiniString) operator+(const iprt::MiniString &a_rstr1, const char *a_psz2);942 RTDECL(const RTCString) operator+(const RTCString &a_rstr1, const char *a_psz2); 946 943 947 944 /** … … 952 949 * @returns the concatenate string. 953 950 * 954 * @relates iprt::MiniString951 * @relates RTCString 955 952 */ 956 RTDECL(const iprt::MiniString) operator+(const char *a_psz1, const iprt::MiniString &a_rstr2);953 RTDECL(const RTCString) operator+(const char *a_psz1, const RTCString &a_rstr2); 957 954 958 955 /** @} */ -
trunk/include/iprt/cpp/xml.h
r36523 r36527 465 465 const AttributeNode* findAttribute(const char *pcszMatch) const; 466 466 bool getAttributeValue(const char *pcszMatch, const char *&ppcsz) const; 467 bool getAttributeValue(const char *pcszMatch, iprt::MiniString &str) const;468 bool getAttributeValuePath(const char *pcszMatch, iprt::MiniString &str) const;467 bool getAttributeValue(const char *pcszMatch, RTCString &str) const; 468 bool getAttributeValuePath(const char *pcszMatch, RTCString &str) const; 469 469 bool getAttributeValue(const char *pcszMatch, int32_t &i) const; 470 470 bool getAttributeValue(const char *pcszMatch, uint32_t &i) const; … … 476 476 477 477 ContentNode* addContent(const char *pcszContent); 478 ContentNode* addContent(const iprt::MiniString &strContent)478 ContentNode* addContent(const RTCString &strContent) 479 479 { 480 480 return addContent(strContent.c_str()); … … 482 482 483 483 AttributeNode* setAttribute(const char *pcszName, const char *pcszValue); 484 AttributeNode* setAttribute(const char *pcszName, const iprt::MiniString &strValue)484 AttributeNode* setAttribute(const char *pcszName, const RTCString &strValue) 485 485 { 486 486 return setAttribute(pcszName, strValue.c_str()); 487 487 } 488 AttributeNode* setAttributePath(const char *pcszName, const iprt::MiniString &strValue);488 AttributeNode* setAttributePath(const char *pcszName, const RTCString &strValue); 489 489 AttributeNode* setAttribute(const char *pcszName, int32_t i); 490 490 AttributeNode* setAttribute(const char *pcszName, uint32_t i); … … 550 550 AttributeNode(const AttributeNode &x); // no copying 551 551 552 iprt::MiniString m_strKey;552 RTCString m_strKey; 553 553 554 554 friend class Node; … … 651 651 ~XmlMemParser(); 652 652 653 void read(const void* pvBuf, size_t cbSize, const iprt::MiniString &strFilename, Document &doc);653 void read(const void* pvBuf, size_t cbSize, const RTCString &strFilename, Document &doc); 654 654 }; 655 655 … … 665 665 ~XmlFileParser(); 666 666 667 void read(const iprt::MiniString &strFilename, Document &doc);667 void read(const RTCString &strFilename, Document &doc); 668 668 669 669 private: -
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r36303 r36527 1928 1928 bool fEnable = false; 1929 1929 bool fFlagsPresent = false; 1930 iprt::MiniString strFlags;1930 RTCString strFlags; 1931 1931 bool fGroupsPresent = false; 1932 iprt::MiniString strGroups;1932 RTCString strGroups; 1933 1933 bool fDestsPresent = false; 1934 iprt::MiniString strDests;1934 RTCString strDests; 1935 1935 1936 1936 static const RTGETOPTDEF s_aOptions[] = -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp
r33540 r36527 256 256 257 257 char *pszAbsFilePath; 258 if (strOvfFilename.startsWith("S3://", iprt::MiniString::CaseInsensitive) ||259 strOvfFilename.startsWith("SunCloud://", iprt::MiniString::CaseInsensitive) ||260 strOvfFilename.startsWith("webdav://", iprt::MiniString::CaseInsensitive))258 if (strOvfFilename.startsWith("S3://", RTCString::CaseInsensitive) || 259 strOvfFilename.startsWith("SunCloud://", RTCString::CaseInsensitive) || 260 strOvfFilename.startsWith("webdav://", RTCString::CaseInsensitive)) 261 261 pszAbsFilePath = RTStrDup(strOvfFilename.c_str()); 262 262 else … … 928 928 929 929 char *pszAbsFilePath = 0; 930 if (strOutputFile.startsWith("S3://", iprt::MiniString::CaseInsensitive) ||931 strOutputFile.startsWith("SunCloud://", iprt::MiniString::CaseInsensitive) ||932 strOutputFile.startsWith("webdav://", iprt::MiniString::CaseInsensitive))930 if (strOutputFile.startsWith("S3://", RTCString::CaseInsensitive) || 931 strOutputFile.startsWith("SunCloud://", RTCString::CaseInsensitive) || 932 strOutputFile.startsWith("webdav://", RTCString::CaseInsensitive)) 933 933 pszAbsFilePath = RTStrDup(strOutputFile.c_str()); 934 934 else -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r35823 r36527 336 336 { 337 337 Utf8Str strFormat(format); 338 if (strFormat.compare("vmdk", iprt::MiniString::CaseInsensitive) == 0)338 if (strFormat.compare("vmdk", RTCString::CaseInsensitive) == 0) 339 339 strName.append(".vmdk"); 340 else if (strFormat.compare("vhd", iprt::MiniString::CaseInsensitive) == 0)340 else if (strFormat.compare("vhd", RTCString::CaseInsensitive) == 0) 341 341 strName.append(".vhd"); 342 342 else -
trunk/src/VBox/Main/glue/string.cpp
r36429 r36527 151 151 * is valid UTF-16. 152 152 * 153 * @sa iprt::MiniString::copyFromN153 * @sa RTCString::copyFromN 154 154 */ 155 155 void Utf8Str::copyFrom(CBSTR a_pbstr) -
trunk/src/VBox/Main/include/ExtPackUtil.h
r35523 r36527 66 66 { 67 67 /** The name. */ 68 iprt::MiniString strName;68 RTCString strName; 69 69 /** The module name. */ 70 iprt::MiniString strModule;70 RTCString strModule; 71 71 /** The description. */ 72 iprt::MiniString strDescription;72 RTCString strDescription; 73 73 /** The frontend or component which it plugs into. */ 74 iprt::MiniString strFrontend;74 RTCString strFrontend; 75 75 } VBOXEXTPACKPLUGINDESC; 76 76 /** Pointer to a plug-in descriptor. */ … … 85 85 { 86 86 /** The name. */ 87 iprt::MiniString strName;87 RTCString strName; 88 88 /** The description. */ 89 iprt::MiniString strDescription;89 RTCString strDescription; 90 90 /** The version string. */ 91 iprt::MiniString strVersion;91 RTCString strVersion; 92 92 /** The internal revision number. */ 93 93 uint32_t uRevision; 94 94 /** The name of the main module. */ 95 iprt::MiniString strMainModule;95 RTCString strMainModule; 96 96 /** The name of the VRDE module, empty if none. */ 97 iprt::MiniString strVrdeModule;97 RTCString strVrdeModule; 98 98 /** The number of plug-in descriptors. */ 99 99 uint32_t cPlugIns; … … 111 111 112 112 void VBoxExtPackInitDesc(PVBOXEXTPACKDESC a_pExtPackDesc); 113 iprt::MiniString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo);114 iprt::MiniString *VBoxExtPackLoadDescFromVfsFile(RTVFSFILE hVfsFile, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo);115 iprt::MiniString *VBoxExtPackExtractNameFromTarballPath(const char *pszTarball);113 RTCString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo); 114 RTCString *VBoxExtPackLoadDescFromVfsFile(RTVFSFILE hVfsFile, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo); 115 RTCString *VBoxExtPackExtractNameFromTarballPath(const char *pszTarball); 116 116 void VBoxExtPackFreeDesc(PVBOXEXTPACKDESC a_pExtPackDesc); 117 117 bool VBoxExtPackIsValidName(const char *pszName); 118 118 bool VBoxExtPackIsValidMangledName(const char *pszMangledName, size_t cchMax = RTSTR_MAX); 119 iprt::MiniString *VBoxExtPackMangleName(const char *pszName);120 iprt::MiniString *VBoxExtPackUnmangleName(const char *pszMangledName, size_t cbMax);119 RTCString *VBoxExtPackMangleName(const char *pszName); 120 RTCString *VBoxExtPackUnmangleName(const char *pszMangledName, size_t cbMax); 121 121 int VBoxExtPackCalcDir(char *pszExtPackDir, size_t cbExtPackDir, const char *pszParentDir, const char *pszName); 122 122 bool VBoxExtPackIsValidVersionString(const char *pszName); -
trunk/src/VBox/Main/include/HostHardwareLinux.h
r34341 r36527 1 1 /* $Id$ */ 2 2 /** @file 3 * Classes for handling hardware detection under Linux.3 * VirtualBox Main - Classes for handling hardware detection under Linux. 4 4 * 5 5 * Please feel free to expand these to work for other systems (Solaris!) or to … … 40 40 { 41 41 /** The device node of the drive. */ 42 iprt::MiniString mDevice;42 RTCString mDevice; 43 43 /** A unique identifier for the device, if available. This should be 44 44 * kept consistent across different probing methods of a given 45 45 * platform if at all possible. */ 46 iprt::MiniString mUdi;46 RTCString mUdi; 47 47 /** A textual description of the drive. */ 48 iprt::MiniString mDescription;48 RTCString mDescription; 49 49 50 50 /** Constructors */ 51 DriveInfo(const iprt::MiniString &aDevice,52 const iprt::MiniString &aUdi = "",53 const iprt::MiniString &aDescription = "")51 DriveInfo(const RTCString &aDevice, 52 const RTCString &aUdi = "", 53 const RTCString &aDescription = "") 54 54 : mDevice(aDevice), 55 55 mUdi(aUdi), -
trunk/src/VBox/Main/include/Performance.h
r36128 r36527 1 1 /* $Id$ */ 2 3 2 /** @file 4 * 5 * VBox Performance Classes declaration. 3 * VirtualBox Main - Performance Classes declaration. 6 4 */ 7 5 … … 534 532 535 533 private: 536 iprt::MiniString mName;534 RTCString mName; 537 535 BaseMetric *mBaseMetric; 538 536 SubMetric *mSubMetric; … … 549 547 static bool patternMatch(const char *pszPat, const char *pszName, 550 548 bool fSeenColon = false); 551 bool match(const ComPtr<IUnknown> object, const iprt::MiniString &name) const;549 bool match(const ComPtr<IUnknown> object, const RTCString &name) const; 552 550 private: 553 551 void init(ComSafeArrayIn(IN_BSTR, metricNames), 554 552 ComSafeArrayIn(IUnknown * , objects)); 555 553 556 typedef std::pair<const ComPtr<IUnknown>, const iprt::MiniString> FilterElement;554 typedef std::pair<const ComPtr<IUnknown>, const RTCString> FilterElement; 557 555 typedef std::list<FilterElement> ElementList; 558 556 -
trunk/src/VBox/Main/include/ovfreader.h
r35536 r36527 1 1 /* $Id$ */ 2 2 /** @file 3 * OVF reader declarations.3 * VirtualBox Main - OVF reader declarations. 4 4 * 5 * Depends only on IPRT, including the iprt::MiniString and IPRT XML classes.5 * Depends only on IPRT, including the RTCString and IPRT XML classes. 6 6 */ 7 7 … … 160 160 { 161 161 // fields from /DiskSection/Disk 162 iprt::MiniString strDiskId; // value from DiskSection/Disk/@diskId162 RTCString strDiskId; // value from DiskSection/Disk/@diskId 163 163 int64_t iCapacity; // value from DiskSection/Disk/@capacity; 164 164 // (maximum size for dynamic images, I guess; we always translate this to bytes) … … 166 166 // (actual used size of disk, always in bytes; can be an estimate of used disk 167 167 // space, but cannot be larger than iCapacity; -1 if not set) 168 iprt::MiniString strFormat; // value from DiskSection/Disk/@format168 RTCString strFormat; // value from DiskSection/Disk/@format 169 169 // typically http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized 170 iprt::MiniString uuidVbox; // optional; if the file was exported by VirtualBox >= 3.2,170 RTCString uuidVbox; // optional; if the file was exported by VirtualBox >= 3.2, 171 171 // then this has the UUID with which the disk was registered 172 172 173 173 // fields from /References/File; the spec says the file reference from disk can be empty, 174 174 // so in that case, strFilename will be empty, then a new disk should be created 175 iprt::MiniString strHref; // value from /References/File/@href (filename); if empty, then the remaining fields are ignored175 RTCString strHref; // value from /References/File/@href (filename); if empty, then the remaining fields are ignored 176 176 int64_t iSize; // value from /References/File/@size (optional according to spec; then we set -1 here) 177 177 int64_t iChunkSize; // value from /References/File/@chunkSize (optional, unsupported) 178 iprt::MiniString strCompression; // value from /References/File/@compression (optional, can be "gzip" according to spec)178 RTCString strCompression; // value from /References/File/@compression (optional, can be "gzip" according to spec) 179 179 180 180 // additional field which has a descriptive size in megabytes derived from the above; this can be used for progress reports … … 207 207 struct VirtualHardwareItem 208 208 { 209 iprt::MiniString strDescription;210 iprt::MiniString strCaption;211 iprt::MiniString strElementName;209 RTCString strDescription; 210 RTCString strCaption; 211 RTCString strElementName; 212 212 213 213 uint32_t ulInstanceID; … … 215 215 216 216 ResourceType_T resourceType; 217 iprt::MiniString strOtherResourceType;218 iprt::MiniString strResourceSubType;217 RTCString strOtherResourceType; 218 RTCString strResourceSubType; 219 219 bool fResourceRequired; 220 220 221 iprt::MiniString strHostResource; // "Abstractly specifies how a device shall connect to a resource on the deployment platform.221 RTCString strHostResource; // "Abstractly specifies how a device shall connect to a resource on the deployment platform. 222 222 // Not all devices need a backing." Used with disk items, for which this references a virtual 223 223 // disk from the Disks section. 224 224 bool fAutomaticAllocation; 225 225 bool fAutomaticDeallocation; 226 iprt::MiniString strConnection; // "All Ethernet adapters that specify the same abstract network connection name within an OVF226 RTCString strConnection; // "All Ethernet adapters that specify the same abstract network connection name within an OVF 227 227 // package shall be deployed on the same network. The abstract network connection name shall be 228 228 // listed in the NetworkSection at the outermost envelope level." We ignore this and only set up 229 229 // a network adapter depending on the network name. 230 iprt::MiniString strAddress; // "Device-specific. For an Ethernet adapter, this specifies the MAC address."230 RTCString strAddress; // "Device-specific. For an Ethernet adapter, this specifies the MAC address." 231 231 int32_t lAddress; // strAddress as an integer, if applicable. 232 iprt::MiniString strAddressOnParent; // "For a device, this specifies its location on the controller."233 iprt::MiniString strAllocationUnits; // "Specifies the units of allocation used. For example, “byte * 2^20”."232 RTCString strAddressOnParent; // "For a device, this specifies its location on the controller." 233 RTCString strAllocationUnits; // "Specifies the units of allocation used. For example, “byte * 2^20”." 234 234 uint64_t ullVirtualQuantity; // "Specifies the quantity of resources presented. For example, “256”." 235 235 uint64_t ullReservation; // "Specifies the minimum quantity of resources guaranteed to be available." … … 237 237 uint64_t ullWeight; // "Specifies a relative priority for this allocation in relation to other allocations." 238 238 239 iprt::MiniString strConsumerVisibility;240 iprt::MiniString strMappingBehavior;241 iprt::MiniString strPoolID;239 RTCString strConsumerVisibility; 240 RTCString strMappingBehavior; 241 RTCString strPoolID; 242 242 uint32_t ulBusNumber; // seen with IDE controllers, but not listed in OVF spec 243 243 … … 257 257 }; 258 258 259 typedef std::map< iprt::MiniString, DiskImage> DiskImagesMap;259 typedef std::map<RTCString, DiskImage> DiskImagesMap; 260 260 261 261 struct VirtualSystem; … … 270 270 ControllerSystemType system; // one of IDE, SATA, SCSI 271 271 272 iprt::MiniString strControllerType;272 RTCString strControllerType; 273 273 // controller subtype (Item/ResourceSubType); e.g. "LsiLogic"; can be empty (esp. for IDE) 274 274 // note that we treat LsiLogicSAS as a SCSI controller (system == SCSI) even though VirtualBox … … 296 296 uint32_t ulAddressOnParent; // parsed strAddressOnParent of hardware item; will be 0 or 1 for IDE 297 297 // and possibly higher for disks attached to SCSI controllers (untested) 298 iprt::MiniString strDiskId; // if the hard disk has an ovf:/disk/<id> reference,298 RTCString strDiskId; // if the hard disk has an ovf:/disk/<id> reference, 299 299 // this receives the <id> component; points to one of the 300 300 // references in Appliance::Data.mapDisks 301 301 }; 302 302 303 typedef std::map< iprt::MiniString, VirtualDisk> VirtualDisksMap;303 typedef std::map<RTCString, VirtualDisk> VirtualDisksMap; 304 304 305 305 /** … … 309 309 struct EthernetAdapter 310 310 { 311 iprt::MiniString strAdapterType; // "PCNet32" or "E1000" or whatever; from <rasd:ResourceSubType>312 iprt::MiniString strNetworkName; // from <rasd:Connection>311 RTCString strAdapterType; // "PCNet32" or "E1000" or whatever; from <rasd:ResourceSubType> 312 RTCString strNetworkName; // from <rasd:Connection> 313 313 }; 314 314 … … 321 321 struct VirtualSystem 322 322 { 323 iprt::MiniString strName; // copy of VirtualSystem/@id324 325 iprt::MiniString strDescription; // copy of VirtualSystem/AnnotationSection content, if any323 RTCString strName; // copy of VirtualSystem/@id 324 325 RTCString strDescription; // copy of VirtualSystem/AnnotationSection content, if any 326 326 327 327 CIMOSType_T cimos; 328 iprt::MiniString strCimosDesc; // readable description of the cimos type in the case of cimos = 0/1/102329 iprt::MiniString strTypeVbox; // optional type from @vbox:ostype attribute (VirtualBox 4.0 or higher)330 331 iprt::MiniString strVirtualSystemType; // generic hardware description; OVF says this can be something like "vmx-4" or "xen";328 RTCString strCimosDesc; // readable description of the cimos type in the case of cimos = 0/1/102 329 RTCString strTypeVbox; // optional type from @vbox:ostype attribute (VirtualBox 4.0 or higher) 330 331 RTCString strVirtualSystemType; // generic hardware description; OVF says this can be something like "vmx-4" or "xen"; 332 332 // VMware Workstation 6.5 is "vmx-07" 333 333 … … 350 350 bool fHasUsbController; // true if there's a USB controller item in mapHardwareItems 351 351 352 iprt::MiniString strSoundCardType; // if not empty, then the system wants a soundcard; this then specifies the hardware;352 RTCString strSoundCardType; // if not empty, then the system wants a soundcard; this then specifies the hardware; 353 353 // VMware Workstation 6.5 uses "ensoniq1371" for example 354 354 355 iprt::MiniString strLicenseText; // license info if any; receives contents of VirtualSystem/EulaSection/License356 357 iprt::MiniString strProduct; // product info if any; receives contents of VirtualSystem/ProductSection/Product358 iprt::MiniString strVendor; // product info if any; receives contents of VirtualSystem/ProductSection/Vendor359 iprt::MiniString strVersion; // product info if any; receives contents of VirtualSystem/ProductSection/Version360 iprt::MiniString strProductUrl; // product info if any; receives contents of VirtualSystem/ProductSection/ProductUrl361 iprt::MiniString strVendorUrl; // product info if any; receives contents of VirtualSystem/ProductSection/VendorUrl355 RTCString strLicenseText; // license info if any; receives contents of VirtualSystem/EulaSection/License 356 357 RTCString strProduct; // product info if any; receives contents of VirtualSystem/ProductSection/Product 358 RTCString strVendor; // product info if any; receives contents of VirtualSystem/ProductSection/Vendor 359 RTCString strVersion; // product info if any; receives contents of VirtualSystem/ProductSection/Version 360 RTCString strProductUrl; // product info if any; receives contents of VirtualSystem/ProductSection/ProductUrl 361 RTCString strVendorUrl; // product info if any; receives contents of VirtualSystem/ProductSection/VendorUrl 362 362 363 363 const xml::ElementNode // pointer to <vbox:Machine> element under <VirtualSystem> element or NULL if not present … … 408 408 { 409 409 public: 410 OVFReader(const void *pvBuf, size_t cbSize, const iprt::MiniString &path);411 OVFReader(const iprt::MiniString &path);410 OVFReader(const void *pvBuf, size_t cbSize, const RTCString &path); 411 OVFReader(const RTCString &path); 412 412 413 413 // Data fields 414 iprt::MiniString m_strPath; // file name given to constructor414 RTCString m_strPath; // file name given to constructor 415 415 DiskImagesMap m_mapDisks; // map of DiskImage structs, sorted by DiskImage.strDiskId 416 416 std::list<VirtualSystem> m_llVirtualSystems; // list of virtual systems, created by and valid after read() -
trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp
r35934 r36527 242 242 m->pVirtualBox = a_pVirtualBox; 243 243 244 iprt::MiniString *pstrTarName = VBoxExtPackExtractNameFromTarballPath(a_pszFile);244 RTCString *pstrTarName = VBoxExtPackExtractNameFromTarballPath(a_pszFile); 245 245 if (pstrTarName) 246 246 { … … 284 284 * Parse the XML. 285 285 */ 286 iprt::MiniString strSavedName(m->Desc.strName);287 iprt::MiniString *pStrLoadErr = VBoxExtPackLoadDescFromVfsFile(hXmlFile, &m->Desc, &m->ObjInfoDesc);286 RTCString strSavedName(m->Desc.strName); 287 RTCString *pStrLoadErr = VBoxExtPackLoadDescFromVfsFile(hXmlFile, &m->Desc, &m->ObjInfoDesc); 288 288 RTVfsFileRelease(hXmlFile); 289 289 if (pStrLoadErr != NULL) … … 1225 1225 * Read the description file. 1226 1226 */ 1227 iprt::MiniString strSavedName(m->Desc.strName);1228 iprt::MiniString *pStrLoadErr = VBoxExtPackLoadDesc(m->strExtPackPath.c_str(), &m->Desc, &m->ObjInfoDesc);1227 RTCString strSavedName(m->Desc.strName); 1228 RTCString *pStrLoadErr = VBoxExtPackLoadDesc(m->strExtPackPath.c_str(), &m->Desc, &m->ObjInfoDesc); 1229 1229 if (pStrLoadErr != NULL) 1230 1230 { … … 1903 1903 if (RT_SUCCESS(vrc)) 1904 1904 { 1905 iprt::MiniString *pstrName = VBoxExtPackUnmangleName(Entry.szName, RTSTR_MAX);1905 RTCString *pstrName = VBoxExtPackUnmangleName(Entry.szName, RTSTR_MAX); 1906 1906 AssertLogRel(pstrName); 1907 1907 if (pstrName) … … 2563 2563 { 2564 2564 AssertReturn(m->enmContext == VBOXEXTPACKCTX_PER_USER_DAEMON, E_UNEXPECTED); 2565 iprt::MiniString const * const pStrName = &a_pExtPackFile->m->Desc.strName;2566 iprt::MiniString const * const pStrTarball = &a_pExtPackFile->m->strExtPackFile;2565 RTCString const * const pStrName = &a_pExtPackFile->m->Desc.strName; 2566 RTCString const * const pStrTarball = &a_pExtPackFile->m->strExtPackFile; 2567 2567 2568 2568 AutoCaller autoCaller(this); -
trunk/src/VBox/Main/src-all/ExtPackUtil.cpp
r35523 r36527 47 47 * (RTMemFree it even on failure) 48 48 */ 49 static iprt::MiniString *49 static RTCString * 50 50 vboxExtPackLoadPlugInDescs(const xml::ElementNode *pVBoxExtPackElm, 51 51 uint32_t *pcPlugIns, PVBOXEXTPACKPLUGINDESC *paPlugIns) … … 98 98 * @param a_pExtPackDesc Where to store the extension pack descriptor. 99 99 */ 100 static iprt::MiniString *vboxExtPackLoadDescFromDoc(xml::Document *a_pDoc, PVBOXEXTPACKDESC a_pExtPackDesc)100 static RTCString *vboxExtPackLoadDescFromDoc(xml::Document *a_pDoc, PVBOXEXTPACKDESC a_pExtPackDesc) 101 101 { 102 102 /* … … 106 106 if ( !pVBoxExtPackElm 107 107 || strcmp(pVBoxExtPackElm->getName(), "VirtualBoxExtensionPack") != 0) 108 return new iprt::MiniString("No VirtualBoxExtensionPack element");109 110 iprt::MiniString strFormatVersion;108 return new RTCString("No VirtualBoxExtensionPack element"); 109 110 RTCString strFormatVersion; 111 111 if (!pVBoxExtPackElm->getAttributeValue("version", strFormatVersion)) 112 return new iprt::MiniString("Missing format version");112 return new RTCString("Missing format version"); 113 113 if (!strFormatVersion.equals("1.0")) 114 return &(new iprt::MiniString("Unsupported format version: "))->append(strFormatVersion);114 return &(new RTCString("Unsupported format version: "))->append(strFormatVersion); 115 115 116 116 /* … … 119 119 const xml::ElementNode *pNameElm = pVBoxExtPackElm->findChildElement("Name"); 120 120 if (!pNameElm) 121 return new iprt::MiniString("The 'Name' element is missing");121 return new RTCString("The 'Name' element is missing"); 122 122 const char *pszName = pNameElm->getValue(); 123 123 if (!VBoxExtPackIsValidName(pszName)) 124 return &(new iprt::MiniString("Invalid name: "))->append(pszName);124 return &(new RTCString("Invalid name: "))->append(pszName); 125 125 126 126 const xml::ElementNode *pDescElm = pVBoxExtPackElm->findChildElement("Description"); 127 127 if (!pDescElm) 128 return new iprt::MiniString("The 'Description' element is missing");128 return new RTCString("The 'Description' element is missing"); 129 129 const char *pszDesc = pDescElm->getValue(); 130 130 if (!pszDesc || *pszDesc == '\0') 131 return new iprt::MiniString("The 'Description' element is empty");131 return new RTCString("The 'Description' element is empty"); 132 132 if (strpbrk(pszDesc, "\n\r\t\v\b") != NULL) 133 return new iprt::MiniString("The 'Description' must not contain control characters");133 return new RTCString("The 'Description' must not contain control characters"); 134 134 135 135 const xml::ElementNode *pVersionElm = pVBoxExtPackElm->findChildElement("Version"); 136 136 if (!pVersionElm) 137 return new iprt::MiniString("The 'Version' element is missing");137 return new RTCString("The 'Version' element is missing"); 138 138 const char *pszVersion = pVersionElm->getValue(); 139 139 if (!pszVersion || *pszVersion == '\0') 140 return new iprt::MiniString("The 'Version' element is empty");140 return new RTCString("The 'Version' element is empty"); 141 141 if (!VBoxExtPackIsValidVersionString(pszVersion)) 142 return &(new iprt::MiniString("Invalid version string: "))->append(pszVersion);142 return &(new RTCString("Invalid version string: "))->append(pszVersion); 143 143 144 144 uint32_t uRevision; … … 148 148 const xml::ElementNode *pMainModuleElm = pVBoxExtPackElm->findChildElement("MainModule"); 149 149 if (!pMainModuleElm) 150 return new iprt::MiniString("The 'MainModule' element is missing");150 return new RTCString("The 'MainModule' element is missing"); 151 151 const char *pszMainModule = pMainModuleElm->getValue(); 152 152 if (!pszMainModule || *pszMainModule == '\0') 153 return new iprt::MiniString("The 'MainModule' element is empty");153 return new RTCString("The 'MainModule' element is empty"); 154 154 if (!VBoxExtPackIsValidModuleString(pszMainModule)) 155 return &(new iprt::MiniString("Invalid main module string: "))->append(pszMainModule);155 return &(new RTCString("Invalid main module string: "))->append(pszMainModule); 156 156 157 157 /* … … 167 167 pszVrdeModule = NULL; 168 168 else if (!VBoxExtPackIsValidModuleString(pszVrdeModule)) 169 return &(new iprt::MiniString("Invalid VRDE module string: "))->append(pszVrdeModule);169 return &(new RTCString("Invalid VRDE module string: "))->append(pszVrdeModule); 170 170 } 171 171 … … 181 181 uint32_t cPlugIns = 0; 182 182 PVBOXEXTPACKPLUGINDESC paPlugIns = NULL; 183 iprt::MiniString *pstrRet = vboxExtPackLoadPlugInDescs(pVBoxExtPackElm, &cPlugIns, &paPlugIns);183 RTCString *pstrRet = vboxExtPackLoadPlugInDescs(pVBoxExtPackElm, &cPlugIns, &paPlugIns); 184 184 if (pstrRet) 185 185 { … … 214 214 * attribs). Optional. 215 215 */ 216 iprt::MiniString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo)216 RTCString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo) 217 217 { 218 218 vboxExtPackClearDesc(a_pExtPackDesc); … … 224 224 int vrc = RTPathJoin(szFilePath, sizeof(szFilePath), a_pszDir, VBOX_EXTPACK_DESCRIPTION_NAME); 225 225 if (RT_FAILURE(vrc)) 226 return new iprt::MiniString("RTPathJoin failed with %Rrc", vrc);226 return new RTCString("RTPathJoin failed with %Rrc", vrc); 227 227 228 228 RTFSOBJINFO ObjInfo; 229 229 vrc = RTPathQueryInfoEx(szFilePath, &ObjInfo, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK); 230 230 if (RT_FAILURE(vrc)) 231 return &(new iprt::MiniString())->printf("RTPathQueryInfoEx failed with %Rrc", vrc);231 return &(new RTCString())->printf("RTPathQueryInfoEx failed with %Rrc", vrc); 232 232 if (a_pObjInfo) 233 233 *a_pObjInfo = ObjInfo; … … 235 235 { 236 236 if (RTFS_IS_SYMLINK(ObjInfo.Attr.fMode)) 237 return new iprt::MiniString("The XML file is symlinked, that is not allowed");238 return &(new iprt::MiniString)->printf("The XML file is not a file (fMode=%#x)", ObjInfo.Attr.fMode);237 return new RTCString("The XML file is symlinked, that is not allowed"); 238 return &(new RTCString)->printf("The XML file is not a file (fMode=%#x)", ObjInfo.Attr.fMode); 239 239 } 240 240 … … 248 248 catch (xml::XmlError Err) 249 249 { 250 return new iprt::MiniString(Err.what());250 return new RTCString(Err.what()); 251 251 } 252 252 } … … 268 268 * attribs). Optional. 269 269 */ 270 iprt::MiniString *VBoxExtPackLoadDescFromVfsFile(RTVFSFILE hVfsFile, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo)270 RTCString *VBoxExtPackLoadDescFromVfsFile(RTVFSFILE hVfsFile, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo) 271 271 { 272 272 vboxExtPackClearDesc(a_pExtPackDesc); … … 278 278 int rc = RTVfsFileQueryInfo(hVfsFile, &ObjInfo, RTFSOBJATTRADD_UNIX); 279 279 if (RT_FAILURE(rc)) 280 return &(new iprt::MiniString)->printf("RTVfsFileQueryInfo failed: %Rrc", rc);280 return &(new RTCString)->printf("RTVfsFileQueryInfo failed: %Rrc", rc); 281 281 if (a_pObjInfo) 282 282 *a_pObjInfo = ObjInfo; … … 289 289 /* Check the file size. */ 290 290 if (ObjInfo.cbObject > _1M || ObjInfo.cbObject < 0) 291 return &(new iprt::MiniString)->printf("The XML file is too large (%'RU64 bytes)", ObjInfo.cbObject);291 return &(new RTCString)->printf("The XML file is too large (%'RU64 bytes)", ObjInfo.cbObject); 292 292 size_t const cbFile = (size_t)ObjInfo.cbObject; 293 293 … … 295 295 rc = RTVfsFileSeek(hVfsFile, 0, RTFILE_SEEK_BEGIN, NULL); 296 296 if (RT_FAILURE(rc)) 297 return &(new iprt::MiniString)->printf("RTVfsFileSeek(,0,BEGIN) failed: %Rrc", rc);297 return &(new RTCString)->printf("RTVfsFileSeek(,0,BEGIN) failed: %Rrc", rc); 298 298 299 299 /* Allocate memory and read the file content into it. */ 300 300 void *pvFile = RTMemTmpAlloc(cbFile); 301 301 if (!pvFile) 302 return &(new iprt::MiniString)->printf("RTMemTmpAlloc(%zu) failed", cbFile);303 304 iprt::MiniString *pstrErr = NULL;302 return &(new RTCString)->printf("RTMemTmpAlloc(%zu) failed", cbFile); 303 304 RTCString *pstrErr = NULL; 305 305 rc = RTVfsFileRead(hVfsFile, pvFile, cbFile, NULL); 306 306 if (RT_FAILURE(rc)) 307 pstrErr = &(new iprt::MiniString)->printf("RTVfsFileRead failed: %Rrc", rc);307 pstrErr = &(new RTCString)->printf("RTVfsFileRead failed: %Rrc", rc); 308 308 309 309 /* … … 314 314 { 315 315 xml::XmlMemParser Parser; 316 iprt::MiniString strFileName = VBOX_EXTPACK_DESCRIPTION_NAME;316 RTCString strFileName = VBOX_EXTPACK_DESCRIPTION_NAME; 317 317 try 318 318 { … … 321 321 catch (xml::XmlError Err) 322 322 { 323 pstrErr = new iprt::MiniString(Err.what());323 pstrErr = new RTCString(Err.what()); 324 324 rc = VERR_PARSE_ERROR; 325 325 } … … 366 366 * @param pszTarball The path to the tarball. 367 367 */ 368 iprt::MiniString *VBoxExtPackExtractNameFromTarballPath(const char *pszTarball)368 RTCString *VBoxExtPackExtractNameFromTarballPath(const char *pszTarball) 369 369 { 370 370 /* … … 470 470 * @sa VBoxExtPackUnmangleName, VBoxExtPackIsValidMangledName 471 471 */ 472 iprt::MiniString *VBoxExtPackMangleName(const char *pszName)472 RTCString *VBoxExtPackMangleName(const char *pszName) 473 473 { 474 474 AssertReturn(VBoxExtPackIsValidName(pszName), NULL); … … 486 486 Assert(VBoxExtPackIsValidMangledName(szTmp)); 487 487 488 return new iprt::MiniString(szTmp, off);488 return new RTCString(szTmp, off); 489 489 } 490 490 … … 498 498 * @sa VBoxExtPackMangleName, VBoxExtPackIsValidMangledName 499 499 */ 500 iprt::MiniString *VBoxExtPackUnmangleName(const char *pszMangledName, size_t cchMax)500 RTCString *VBoxExtPackUnmangleName(const char *pszMangledName, size_t cchMax) 501 501 { 502 502 AssertReturn(VBoxExtPackIsValidMangledName(pszMangledName, cchMax), NULL); … … 517 517 AssertReturn(VBoxExtPackIsValidName(szTmp), NULL); 518 518 519 return new iprt::MiniString(szTmp, off);519 return new RTCString(szTmp, off); 520 520 } 521 521 … … 535 535 AssertReturn(VBoxExtPackIsValidName(pszName), VERR_INTERNAL_ERROR_5); 536 536 537 iprt::MiniString *pstrMangledName = VBoxExtPackMangleName(pszName);537 RTCString *pstrMangledName = VBoxExtPackMangleName(pszName); 538 538 if (!pstrMangledName) 539 539 return VERR_INTERNAL_ERROR_4; … … 665 665 */ 666 666 VBOXEXTPACKDESC ExtPackDesc; 667 iprt::MiniString *pstrErr = VBoxExtPackLoadDescFromVfsFile(hXmlFile, &ExtPackDesc, NULL);667 RTCString *pstrErr = VBoxExtPackLoadDescFromVfsFile(hXmlFile, &ExtPackDesc, NULL); 668 668 if (pstrErr) 669 669 { -
trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp
r35712 r36527 869 869 * Ok, down to business. 870 870 */ 871 iprt::MiniString *pstrMangledName = VBoxExtPackMangleName(pszName);871 RTCString *pstrMangledName = VBoxExtPackMangleName(pszName); 872 872 if (!pstrMangledName) 873 873 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to mangle name ('%s)", pszName); … … 955 955 * Mangle the name so we can construct the directory names. 956 956 */ 957 iprt::MiniString *pstrMangledName = VBoxExtPackMangleName(pszName);957 RTCString *pstrMangledName = VBoxExtPackMangleName(pszName); 958 958 if (!pstrMangledName) 959 959 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to mangle name ('%s)", pszName); 960 iprt::MiniString strMangledName(*pstrMangledName);960 RTCString strMangledName(*pstrMangledName); 961 961 delete pstrMangledName; 962 962 -
trunk/src/VBox/Main/src-server/Performance.cpp
r36226 r36527 1 1 /* $Id$ */ 2 3 2 /** @file 4 *5 3 * VBox Performance Classes implementation. 6 4 */ … … 798 796 pos = name.find(",", startPos)) 799 797 { 800 mElements.push_back(std::make_pair(object, iprt::MiniString(name.substr(startPos, pos - startPos).c_str())));798 mElements.push_back(std::make_pair(object, RTCString(name.substr(startPos, pos - startPos).c_str()))); 801 799 startPos = pos + 1; 802 800 } 803 mElements.push_back(std::make_pair(object, iprt::MiniString(name.substr(startPos).c_str())));801 mElements.push_back(std::make_pair(object, RTCString(name.substr(startPos).c_str()))); 804 802 } 805 803 … … 877 875 } 878 876 879 bool Filter::match(const ComPtr<IUnknown> object, const iprt::MiniString &name) const877 bool Filter::match(const ComPtr<IUnknown> object, const RTCString &name) const 880 878 { 881 879 ElementList::const_iterator it; -
trunk/src/VBox/Main/xml/Settings.cpp
r36521 r36527 142 142 } 143 143 144 iprt::MiniString strFilename;144 RTCString strFilename; 145 145 bool fFileExists; 146 146 -
trunk/src/VBox/Main/xml/ovfreader.cpp
r35566 r36527 1 1 /* $Id$ */ 2 2 /** @file 3 * OVF reader declarations. 3 4 * 4 * OVF reader declarations. Depends only on IPRT, including the iprt::MiniString 5 * and IPRT XML classes. 5 * Depends only on IPRT, including the RTCString and IPRT XML classes. 6 6 */ 7 7 … … 21 21 22 22 using namespace std; 23 using namespace iprt;24 23 using namespace ovf; 25 24 … … 37 36 * @param path path to a filename for error messages. 38 37 */ 39 OVFReader::OVFReader(const void *pvBuf, size_t cbSize, const MiniString &path)38 OVFReader::OVFReader(const void *pvBuf, size_t cbSize, const RTCString &path) 40 39 : m_strPath(path) 41 40 { … … 53 52 * @param path 54 53 */ 55 OVFReader::OVFReader(const MiniString &path)54 OVFReader::OVFReader(const RTCString &path) 56 55 : m_strPath(path) 57 56 { … … 653 652 <rasd:BusNumber>0</rasd:BusNumber> 654 653 </Item> */ 655 if ( i.strCaption.startsWith("sataController", MiniString::CaseInsensitive)656 && !i.strResourceSubType.compare("AHCI", MiniString::CaseInsensitive)654 if ( i.strCaption.startsWith("sataController", RTCString::CaseInsensitive) 655 && !i.strResourceSubType.compare("AHCI", RTCString::CaseInsensitive) 657 656 ) 658 657 { -
trunk/src/VBox/Runtime/common/string/ministring.cpp
r36508 r36527 33 33 *******************************************************************************/ 34 34 #include <iprt/cpp/ministring.h> 35 using namespace iprt;36 35 37 36 … … 39 38 * Global Variables * 40 39 *******************************************************************************/ 41 const size_t MiniString::npos = ~(size_t)0; 40 const size_t RTCString::npos = ~(size_t)0; 41 42 42 43 43 /******************************************************************************* … … 48 48 49 49 50 MiniString &MiniString::printf(const char *pszFormat, ...)50 RTCString &RTCString::printf(const char *pszFormat, ...) 51 51 { 52 52 va_list va; … … 58 58 59 59 /** 60 * Callback used with RTStrFormatV by MiniString::printfV.60 * Callback used with RTStrFormatV by RTCString::printfV. 61 61 * 62 62 * @returns The number of bytes added (not used). … … 67 67 */ 68 68 /*static*/ DECLCALLBACK(size_t) 69 MiniString::printfOutputCallback(void *pvArg, const char *pachChars, size_t cbChars)70 { 71 MiniString *pThis = (MiniString *)pvArg;69 RTCString::printfOutputCallback(void *pvArg, const char *pachChars, size_t cbChars) 70 { 71 RTCString *pThis = (RTCString *)pvArg; 72 72 if (cbChars) 73 73 { … … 94 94 } 95 95 96 MiniString &MiniString::printfV(const char *pszFormat, va_list va)96 RTCString &RTCString::printfV(const char *pszFormat, va_list va) 97 97 { 98 98 cleanup(); … … 101 101 } 102 102 103 MiniString &MiniString::append(const MiniString &that)103 RTCString &RTCString::append(const RTCString &that) 104 104 { 105 105 size_t cchThat = that.length(); … … 125 125 } 126 126 127 MiniString &MiniString::append(const char *pszThat)127 RTCString &RTCString::append(const char *pszThat) 128 128 { 129 129 size_t cchThat = strlen(pszThat); … … 149 149 } 150 150 151 MiniString& MiniString::append(char ch)151 RTCString& RTCString::append(char ch) 152 152 { 153 153 Assert((unsigned char)ch < 0x80); /* Don't create invalid UTF-8. */ … … 170 170 } 171 171 172 MiniString &MiniString::appendCodePoint(RTUNICP uc)172 RTCString &RTCString::appendCodePoint(RTUNICP uc) 173 173 { 174 174 /* … … 176 176 */ 177 177 if (uc < 0x80) 178 return MiniString::append((char)uc);178 return RTCString::append((char)uc); 179 179 180 180 /* … … 200 200 } 201 201 202 size_t MiniString::find(const char *pcszFind, size_t pos /*= 0*/) const202 size_t RTCString::find(const char *pcszFind, size_t pos /*= 0*/) const 203 203 { 204 204 const char *pszThis, *p; … … 213 213 } 214 214 215 void MiniString::findReplace(char cFind, char cReplace)215 void RTCString::findReplace(char cFind, char cReplace) 216 216 { 217 217 for (size_t i = 0; i < length(); ++i) … … 223 223 } 224 224 225 MiniString MiniString::substrCP(size_t pos /*= 0*/, size_t n /*= npos*/) const226 { 227 MiniString ret;225 RTCString RTCString::substrCP(size_t pos /*= 0*/, size_t n /*= npos*/) const 226 { 227 RTCString ret; 228 228 229 229 if (n) … … 271 271 } 272 272 273 bool MiniString::endsWith(const MiniString &that, CaseSensitivity cs /*= CaseSensitive*/) const273 bool RTCString::endsWith(const RTCString &that, CaseSensitivity cs /*= CaseSensitive*/) const 274 274 { 275 275 size_t l1 = length(); … … 289 289 } 290 290 291 bool MiniString::startsWith(const MiniString &that, CaseSensitivity cs /*= CaseSensitive*/) const291 bool RTCString::startsWith(const RTCString &that, CaseSensitivity cs /*= CaseSensitive*/) const 292 292 { 293 293 size_t l1 = length(); … … 304 304 } 305 305 306 bool MiniString::contains(const MiniString &that, CaseSensitivity cs /*= CaseSensitive*/) const306 bool RTCString::contains(const RTCString &that, CaseSensitivity cs /*= CaseSensitive*/) const 307 307 { 308 308 /** @todo r-bird: Not checking for NULL strings like startsWith does (and … … 313 313 } 314 314 315 int MiniString::toInt(uint64_t &i) const315 int RTCString::toInt(uint64_t &i) const 316 316 { 317 317 if (!m_psz) … … 320 320 } 321 321 322 int MiniString::toInt(uint32_t &i) const322 int RTCString::toInt(uint32_t &i) const 323 323 { 324 324 if (!m_psz) … … 327 327 } 328 328 329 iprt::list< iprt::MiniString, iprt::MiniString *>330 MiniString::split(const iprt::MiniString &a_rstrSep, SplitMode mode /* = RemoveEmptyParts */)331 { 332 iprt::list< iprt::MiniString> strRet;329 iprt::list<RTCString, RTCString *> 330 RTCString::split(const RTCString &a_rstrSep, SplitMode mode /* = RemoveEmptyParts */) 331 { 332 iprt::list<RTCString> strRet; 333 333 if (!m_psz) 334 334 return strRet; 335 335 if (a_rstrSep.isEmpty()) 336 336 { 337 strRet.append( iprt::MiniString(m_psz));337 strRet.append(RTCString(m_psz)); 338 338 return strRet; 339 339 } … … 346 346 if (!pszNext) 347 347 { 348 strRet.append( iprt::MiniString(pszTmp, cch));348 strRet.append(RTCString(pszTmp, cch)); 349 349 break; 350 350 } … … 352 352 if ( cchNext > 0 353 353 || mode == KeepEmptyParts) 354 strRet.append( iprt::MiniString(pszTmp, cchNext));354 strRet.append(RTCString(pszTmp, cchNext)); 355 355 pszTmp += cchNext + a_rstrSep.length(); 356 356 cch -= cchNext + a_rstrSep.length(); … … 361 361 362 362 /* static */ 363 iprt::MiniString364 MiniString::join(const iprt::list<iprt::MiniString, iprt::MiniString*> &a_rList,365 const iprt::MiniString &a_rstrSep /* = "" */)366 { 367 MiniString strRet;363 RTCString 364 RTCString::join(const iprt::list<RTCString, RTCString*> &a_rList, 365 const RTCString &a_rstrSep /* = "" */) 366 { 367 RTCString strRet; 368 368 if (a_rList.size() > 1) 369 369 { … … 376 376 } 377 377 378 const iprt::MiniString operator+(const iprt::MiniString &a_rStr1, const iprt::MiniString &a_rStr2)379 { 380 iprt::MiniString strRet(a_rStr1);378 const RTCString operator+(const RTCString &a_rStr1, const RTCString &a_rStr2) 379 { 380 RTCString strRet(a_rStr1); 381 381 strRet += a_rStr2; 382 382 return strRet; 383 383 } 384 384 385 const iprt::MiniString operator+(const iprt::MiniString &a_rStr1, const char *a_pszStr2)386 { 387 iprt::MiniString strRet(a_rStr1);385 const RTCString operator+(const RTCString &a_rStr1, const char *a_pszStr2) 386 { 387 RTCString strRet(a_rStr1); 388 388 strRet += a_pszStr2; 389 389 return strRet; 390 390 } 391 391 392 const iprt::MiniString operator+(const char *a_psz1, const iprt::MiniString &a_rStr2)393 { 394 iprt::MiniString strRet(a_psz1);392 const RTCString operator+(const char *a_psz1, const RTCString &a_rStr2) 393 { 394 RTCString strRet(a_psz1); 395 395 strRet += a_rStr2; 396 396 return strRet; -
trunk/src/VBox/Runtime/r3/xml.cpp
r36523 r36527 175 175 { } 176 176 177 iprt::MiniString strFileName;177 RTCString strFileName; 178 178 RTFILE handle; 179 179 bool opened : 1; … … 825 825 * @return TRUE if attribute was found and str was thus updated. 826 826 */ 827 bool ElementNode::getAttributeValue(const char *pcszMatch, iprt::MiniString &str) const827 bool ElementNode::getAttributeValue(const char *pcszMatch, RTCString &str) const 828 828 { 829 829 const Node* pAttr; … … 844 844 * @return 845 845 */ 846 bool ElementNode::getAttributeValuePath(const char *pcszMatch, iprt::MiniString &str) const846 bool ElementNode::getAttributeValuePath(const char *pcszMatch, RTCString &str) const 847 847 { 848 848 if (getAttributeValue(pcszMatch, str)) … … 1078 1078 * @return 1079 1079 */ 1080 AttributeNode* ElementNode::setAttributePath(const char *pcszName, const iprt::MiniString &strValue)1081 { 1082 iprt::MiniString strTemp(strValue);1080 AttributeNode* ElementNode::setAttributePath(const char *pcszName, const RTCString &strValue) 1081 { 1082 RTCString strTemp(strValue); 1083 1083 strTemp.findReplace('\\', '/'); 1084 1084 return setAttribute(pcszName, strTemp.c_str()); … … 1482 1482 */ 1483 1483 void XmlMemParser::read(const void* pvBuf, size_t cbSize, 1484 const iprt::MiniString &strFilename,1484 const RTCString &strFilename, 1485 1485 Document &doc) 1486 1486 { … … 1540 1540 struct XmlFileParser::Data 1541 1541 { 1542 iprt::MiniString strXmlFilename;1542 RTCString strXmlFilename; 1543 1543 1544 1544 Data() … … 1566 1566 { 1567 1567 File file; 1568 iprt::MiniString error;1568 RTCString error; 1569 1569 1570 1570 IOContext(const char *pcszFilename, File::Mode mode, bool fFlush = false) … … 1609 1609 * @param doc out: document to be reset and filled with data according to file contents. 1610 1610 */ 1611 void XmlFileParser::read(const iprt::MiniString &strFilename,1611 void XmlFileParser::read(const RTCString &strFilename, 1612 1612 Document &doc) 1613 1613 { -
trunk/src/VBox/Runtime/testcase/tstIprtList.cpp
r36525 r36527 567 567 * Big size type (translate to internal pointer list). 568 568 */ 569 test1<iprt::list, iprt::MiniString, iprt::MiniString*, const char *>("ST: Class type", g_apszTestStrings, RT_ELEMENTS(g_apszTestStrings));570 test1<iprt::mtlist, iprt::MiniString, iprt::MiniString*, const char *>("MT: Class type", g_apszTestStrings, RT_ELEMENTS(g_apszTestStrings));569 test1<iprt::list, RTCString, RTCString *, const char *>("ST: Class type", g_apszTestStrings, RT_ELEMENTS(g_apszTestStrings)); 570 test1<iprt::mtlist, RTCString, RTCString *, const char *>("MT: Class type", g_apszTestStrings, RT_ELEMENTS(g_apszTestStrings)); 571 571 572 572 /* -
trunk/src/VBox/Runtime/testcase/tstIprtMiniString.cpp
r36501 r36527 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT Testcase - iprt::MiniString.3 * IPRT Testcase - RTCString. 4 4 */ 5 5 … … 42 42 va_list va; 43 43 va_start(va, pszFormat); 44 iprt::MiniString strTst(pszFormat, va);44 RTCString strTst(pszFormat, va); 45 45 va_end(va); 46 46 RTTESTI_CHECK_MSG(strTst.equals(pszExpect), ("strTst='%s' expected='%s'\n", strTst.c_str(), pszExpect)); … … 70 70 } while (0) 71 71 72 iprt::MiniString empty;72 RTCString empty; 73 73 CHECK(empty.length() == 0); 74 74 CHECK(empty.capacity() == 0); 75 75 76 iprt::MiniString sixbytes("12345");76 RTCString sixbytes("12345"); 77 77 CHECK(sixbytes.length() == 5); 78 78 CHECK(sixbytes.capacity() == 6); 79 79 80 sixbytes.append( iprt::MiniString("678"));80 sixbytes.append(RTCString("678")); 81 81 CHECK(sixbytes.length() == 8); 82 82 CHECK(sixbytes.capacity() >= 9); … … 95 95 CHECK(sixbytes.capacity() == 7); 96 96 97 iprt::MiniString morebytes("tobereplaced");97 RTCString morebytes("tobereplaced"); 98 98 morebytes = "newstring "; 99 99 morebytes.append(sixbytes); … … 101 101 CHECK_DUMP(morebytes == "newstring 123456", morebytes.c_str()); 102 102 103 iprt::MiniString third(morebytes);103 RTCString third(morebytes); 104 104 third.reserve(100 * 1024); // 100 KB 105 105 CHECK_DUMP(third == "newstring 123456", morebytes.c_str() ); … … 107 107 CHECK(third.length() == morebytes.length()); // must not have changed 108 108 109 iprt::MiniString copy1(morebytes);110 iprt::MiniString copy2 = morebytes;109 RTCString copy1(morebytes); 110 RTCString copy2 = morebytes; 111 111 CHECK(copy1 == copy2); 112 112 … … 117 117 CHECK(copy1.length() == 0); 118 118 119 CHECK( iprt::MiniString("abc") < iprt::MiniString("def"));120 CHECK( iprt::MiniString("") < iprt::MiniString("def"));121 CHECK( iprt::MiniString("abc") > iprt::MiniString(""));122 CHECK( iprt::MiniString("abc") != iprt::MiniString("def"));123 CHECK_DUMP_I( iprt::MiniString("def") > iprt::MiniString("abc"));124 CHECK( iprt::MiniString("abc") == iprt::MiniString("abc"));125 CHECK( iprt::MiniString("").compare("") == 0);126 CHECK( iprt::MiniString("").compare(NULL) == 0);127 CHECK( iprt::MiniString("").compare("a") < 0);128 CHECK( iprt::MiniString("a").compare("") > 0);129 CHECK( iprt::MiniString("a").compare(NULL) > 0);130 131 CHECK( iprt::MiniString("abc") < "def");132 CHECK( iprt::MiniString("abc") != "def");133 CHECK_DUMP_I( iprt::MiniString("def") > "abc");134 CHECK( iprt::MiniString("abc") == "abc");135 136 CHECK( iprt::MiniString("abc").equals("abc"));137 CHECK(! iprt::MiniString("abc").equals("def"));138 CHECK( iprt::MiniString("abc").equalsIgnoreCase("Abc"));139 CHECK( iprt::MiniString("abc").equalsIgnoreCase("ABc"));140 CHECK( iprt::MiniString("abc").equalsIgnoreCase("ABC"));141 CHECK(! iprt::MiniString("abc").equalsIgnoreCase("dBC"));142 CHECK( iprt::MiniString("").equals(""));143 CHECK( iprt::MiniString("").equals(NULL));144 CHECK(! iprt::MiniString("").equals("a"));145 CHECK(! iprt::MiniString("a").equals(""));146 CHECK(! iprt::MiniString("a").equals(NULL));147 CHECK( iprt::MiniString("").equalsIgnoreCase(""));148 CHECK( iprt::MiniString("").equalsIgnoreCase(NULL));149 CHECK(! iprt::MiniString("").equalsIgnoreCase("a"));150 CHECK(! iprt::MiniString("a").equalsIgnoreCase(""));119 CHECK(RTCString("abc") < RTCString("def")); 120 CHECK(RTCString("") < RTCString("def")); 121 CHECK(RTCString("abc") > RTCString("")); 122 CHECK(RTCString("abc") != RTCString("def")); 123 CHECK_DUMP_I(RTCString("def") > RTCString("abc")); 124 CHECK(RTCString("abc") == RTCString("abc")); 125 CHECK(RTCString("").compare("") == 0); 126 CHECK(RTCString("").compare(NULL) == 0); 127 CHECK(RTCString("").compare("a") < 0); 128 CHECK(RTCString("a").compare("") > 0); 129 CHECK(RTCString("a").compare(NULL) > 0); 130 131 CHECK(RTCString("abc") < "def"); 132 CHECK(RTCString("abc") != "def"); 133 CHECK_DUMP_I(RTCString("def") > "abc"); 134 CHECK(RTCString("abc") == "abc"); 135 136 CHECK(RTCString("abc").equals("abc")); 137 CHECK(!RTCString("abc").equals("def")); 138 CHECK(RTCString("abc").equalsIgnoreCase("Abc")); 139 CHECK(RTCString("abc").equalsIgnoreCase("ABc")); 140 CHECK(RTCString("abc").equalsIgnoreCase("ABC")); 141 CHECK(!RTCString("abc").equalsIgnoreCase("dBC")); 142 CHECK(RTCString("").equals("")); 143 CHECK(RTCString("").equals(NULL)); 144 CHECK(!RTCString("").equals("a")); 145 CHECK(!RTCString("a").equals("")); 146 CHECK(!RTCString("a").equals(NULL)); 147 CHECK(RTCString("").equalsIgnoreCase("")); 148 CHECK(RTCString("").equalsIgnoreCase(NULL)); 149 CHECK(!RTCString("").equalsIgnoreCase("a")); 150 CHECK(!RTCString("a").equalsIgnoreCase("")); 151 151 152 152 copy2.setNull(); … … 167 167 168 168 /* printf */ 169 iprt::MiniString StrFmt;169 RTCString StrFmt; 170 170 CHECK(StrFmt.printf("%s-%s-%d", "abc", "def", 42).equals("abc-def-42")); 171 171 test1Hlp1("abc-42-def", "%s-%d-%s", "abc", 42, "def"); … … 175 175 176 176 /* substring constructors */ 177 iprt::MiniString SubStr1("", (size_t)0);177 RTCString SubStr1("", (size_t)0); 178 178 CHECK_EQUAL(SubStr1, ""); 179 179 180 iprt::MiniString SubStr2("abcdef", 2);180 RTCString SubStr2("abcdef", 2); 181 181 CHECK_EQUAL(SubStr2, "ab"); 182 182 183 iprt::MiniString SubStr3("abcdef", 1);183 RTCString SubStr3("abcdef", 1); 184 184 CHECK_EQUAL(SubStr3, "a"); 185 185 186 iprt::MiniString SubStr4("abcdef", 6);186 RTCString SubStr4("abcdef", 6); 187 187 CHECK_EQUAL(SubStr4, "abcdef"); 188 188 189 iprt::MiniString SubStr5("abcdef", 7);189 RTCString SubStr5("abcdef", 7); 190 190 CHECK_EQUAL(SubStr5, "abcdef"); 191 191 192 192 193 iprt::MiniString SubStrBase("abcdef");194 195 iprt::MiniString SubStr10(SubStrBase, 0);193 RTCString SubStrBase("abcdef"); 194 195 RTCString SubStr10(SubStrBase, 0); 196 196 CHECK_EQUAL(SubStr10, "abcdef"); 197 197 198 iprt::MiniString SubStr11(SubStrBase, 1);198 RTCString SubStr11(SubStrBase, 1); 199 199 CHECK_EQUAL(SubStr11, "bcdef"); 200 200 201 iprt::MiniString SubStr12(SubStrBase, 1, 1);201 RTCString SubStr12(SubStrBase, 1, 1); 202 202 CHECK_EQUAL(SubStr12, "b"); 203 203 204 iprt::MiniString SubStr13(SubStrBase, 2, 3);204 RTCString SubStr13(SubStrBase, 2, 3); 205 205 CHECK_EQUAL(SubStr13, "cde"); 206 206 207 iprt::MiniString SubStr14(SubStrBase, 2, 4);207 RTCString SubStr14(SubStrBase, 2, 4); 208 208 CHECK_EQUAL(SubStr14, "cdef"); 209 209 210 iprt::MiniString SubStr15(SubStrBase, 2, 5);210 RTCString SubStr15(SubStrBase, 2, 5); 211 211 CHECK_EQUAL(SubStr15, "cdef"); 212 212 213 213 /* substr() and substrCP() functions */ 214 iprt::MiniString strTest("");214 RTCString strTest(""); 215 215 CHECK_EQUAL(strTest.substr(0), ""); 216 216 CHECK_EQUAL(strTest.substrCP(0), ""); … … 257 257 258 258 /* split */ 259 iprt::list< iprt::MiniString> spList1 = iprt::MiniString("##abcdef##abcdef####abcdef##").split("##", iprt::MiniString::RemoveEmptyParts);259 iprt::list<RTCString> spList1 = RTCString("##abcdef##abcdef####abcdef##").split("##", RTCString::RemoveEmptyParts); 260 260 RTTESTI_CHECK(spList1.size() == 3); 261 261 for (size_t i = 0; i < spList1.size(); ++i) 262 262 RTTESTI_CHECK(spList1.at(i) == "abcdef"); 263 iprt::list< iprt::MiniString> spList2 = iprt::MiniString("##abcdef##abcdef####abcdef##").split("##", iprt::MiniString::KeepEmptyParts);263 iprt::list<RTCString> spList2 = RTCString("##abcdef##abcdef####abcdef##").split("##", RTCString::KeepEmptyParts); 264 264 RTTESTI_CHECK_RETV(spList2.size() == 5); 265 265 RTTESTI_CHECK(spList2.at(0) == ""); … … 268 268 RTTESTI_CHECK(spList2.at(3) == ""); 269 269 RTTESTI_CHECK(spList2.at(4) == "abcdef"); 270 iprt::list< iprt::MiniString> spList3 = iprt::MiniString().split("##", iprt::MiniString::KeepEmptyParts);270 iprt::list<RTCString> spList3 = RTCString().split("##", RTCString::KeepEmptyParts); 271 271 RTTESTI_CHECK(spList3.size() == 0); 272 iprt::list< iprt::MiniString> spList4 = iprt::MiniString().split("");272 iprt::list<RTCString> spList4 = RTCString().split(""); 273 273 RTTESTI_CHECK(spList4.size() == 0); 274 iprt::list< iprt::MiniString> spList5 = iprt::MiniString("abcdef").split("");274 iprt::list<RTCString> spList5 = RTCString("abcdef").split(""); 275 275 RTTESTI_CHECK_RETV(spList5.size() == 1); 276 276 RTTESTI_CHECK(spList5.at(0) == "abcdef"); 277 277 278 278 /* join */ 279 iprt::list< iprt::MiniString> jnList;280 strTest = iprt::MiniString::join(jnList);279 iprt::list<RTCString> jnList; 280 strTest = RTCString::join(jnList); 281 281 RTTESTI_CHECK(strTest == ""); 282 strTest = iprt::MiniString::join(jnList, "##");282 strTest = RTCString::join(jnList, "##"); 283 283 RTTESTI_CHECK(strTest == ""); 284 284 for (size_t i = 0; i < 5; ++i) 285 285 jnList.append("abcdef"); 286 strTest = iprt::MiniString::join(jnList);286 strTest = RTCString::join(jnList); 287 287 RTTESTI_CHECK(strTest == "abcdefabcdefabcdefabcdefabcdef"); 288 strTest = iprt::MiniString::join(jnList, "##");288 strTest = RTCString::join(jnList, "##"); 289 289 RTTESTI_CHECK(strTest == "abcdef##abcdef##abcdef##abcdef##abcdef"); 290 290 291 291 /* special constructor and assignment arguments */ 292 iprt::MiniString StrCtor1("");292 RTCString StrCtor1(""); 293 293 RTTESTI_CHECK(StrCtor1.isEmpty()); 294 294 RTTESTI_CHECK(StrCtor1.length() == 0); 295 295 296 iprt::MiniString StrCtor2(NULL);296 RTCString StrCtor2(NULL); 297 297 RTTESTI_CHECK(StrCtor2.isEmpty()); 298 298 RTTESTI_CHECK(StrCtor2.length() == 0); 299 299 300 iprt::MiniString StrCtor1d(StrCtor1);300 RTCString StrCtor1d(StrCtor1); 301 301 RTTESTI_CHECK(StrCtor1d.isEmpty()); 302 302 RTTESTI_CHECK(StrCtor1d.length() == 0); 303 303 304 iprt::MiniString StrCtor2d(StrCtor2);304 RTCString StrCtor2d(StrCtor2); 305 305 RTTESTI_CHECK(StrCtor2d.isEmpty()); 306 306 RTTESTI_CHECK(StrCtor2d.length() == 0); … … 308 308 for (unsigned i = 0; i < 2; i++) 309 309 { 310 iprt::MiniString StrAssign;310 RTCString StrAssign; 311 311 if (i) StrAssign = "abcdef"; 312 312 StrAssign = (char *)NULL; … … 362 362 } while (0) 363 363 364 iprt::MiniString strTmp;364 RTCString strTmp; 365 365 char szDst[16]; 366 366 367 367 /* Collect all upper and lower case code points. */ 368 iprt::MiniString strLower("");368 RTCString strLower(""); 369 369 strLower.reserve(_4M); 370 370 371 iprt::MiniString strUpper("");371 RTCString strUpper(""); 372 372 strUpper.reserve(_4M); 373 373 … … 392 392 size_t cch = 0; 393 393 const char *pszCur = strLower.c_str(); 394 iprt::MiniString strUpper2("");394 RTCString strUpper2(""); 395 395 strUpper2.reserve(strLower.length() + 64); 396 396 for (;;) … … 436 436 cch = 0; 437 437 pszCur = strUpper.c_str(); 438 iprt::MiniString strLower2("");438 RTCString strLower2(""); 439 439 strLower2.reserve(strUpper.length() + 64); 440 440 for (;;)
Note:
See TracChangeset
for help on using the changeset viewer.