VirtualBox

Changeset 21077 in vbox for trunk/src/VBox/Main/glue


Ignore:
Timestamp:
Jun 30, 2009 3:19:12 PM (15 years ago)
Author:
vboxsync
Message:

back out r49329, r49331, will start over

Location:
trunk/src/VBox/Main/glue
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/ErrorInfo.cpp

    r21073 r21077  
    118118
    119119                    Utf8Str message;
    120                     rc = ex->GetMessage(message.asOutParam());
    121                     message.jolt();
     120                    rc = ex->GetMessage (message.asOutParam());
    122121                    gotSomething |= NS_SUCCEEDED (rc);
    123122                    if (NS_SUCCEEDED (rc))
     
    183182    LONG lrc;
    184183
    185     rc = info->COMGETTER(ResultCode) (&lrc); mResultCode = lrc;
     184    rc = info->COMGETTER(ResultCode) (&lrc); mResultCode = lrc;   
    186185    gotSomething |= SUCCEEDED (rc);
    187186    gotAll &= SUCCEEDED (rc);
  • trunk/src/VBox/Main/glue/VirtualBoxErrorInfo.cpp

    r21073 r21077  
    179179    AssertComRC (rc);
    180180    Utf8Str message;
    181     rc = aInfo->GetMessage(message.asOutParam());
    182     message.jolt();
     181    rc = aInfo->GetMessage (message.asOutParam());
    183182    AssertComRC (rc);
    184183    mText = message;
  • trunk/src/VBox/Main/glue/string.cpp

    r21073 r21077  
    2626
    2727#include <iprt/err.h>
    28 #include <iprt/path.h>
    2928
    3029namespace com
     
    8685
    8786                size_t cbCopy = psz - pFirst;
    88                 ret.reserve(cbCopy + 1);
    89                 memcpy(ret.m_psz, pFirst, cbCopy);
    90                 ret.m_psz[cbCopy] = '\0';
     87                ret.alloc(cbCopy + 1);
     88                memcpy(ret.str, pFirst, cbCopy);
     89                ret.str[cbCopy] = '\0';
    9190            }
    9291        }
     
    9695}
    9796
    98 bool Utf8Str::endsWith(const Utf8Str &that, CaseSensitivity cs /*= CaseSensitive*/) const
    99 {
    100     size_t l1 = length();
    101     if (l1 == 0)
    102         return false;
    103 
    104     size_t l2 = that.length();
    105     if (l1 < l2)
    106         return false;
    107 
    108     size_t l = l1 - l2;
    109     if (cs == CaseSensitive)
    110         return ::RTStrCmp(&m_psz[l], that.m_psz) == 0;
    111     else
    112         return ::RTStrICmp(&m_psz[l], that.m_psz) == 0;
    113 }
    114 
    115 bool Utf8Str::startsWith(const Utf8Str &that, CaseSensitivity cs /*= CaseSensitive*/) const
    116 {
    117     size_t l1 = length();
    118     size_t l2 = that.length();
    119     if (l1 == 0 || l2 == 0)
    120         return false;
    121 
    122     if (l1 < l2)
    123         return false;
    124 
    125     if (cs == CaseSensitive)
    126         return ::RTStrNCmp(m_psz, that.m_psz, l2) == 0;
    127     else
    128         return ::RTStrNICmp(m_psz, that.m_psz, l2) == 0;
    129 }
    130 
    131 bool Utf8Str::contains(const Utf8Str &that, CaseSensitivity cs /*= CaseSensitive*/) const
    132 {
    133     if (cs == CaseSensitive)
    134         return ::RTStrStr(m_psz, that.m_psz) != NULL;
    135     else
    136         return ::RTStrIStr(m_psz, that.m_psz) != NULL;
    137 }
    138 
    139 Utf8Str& Utf8Str::toLower()
    140 {
    141     if (!isEmpty())
    142         ::RTStrToLower(m_psz);
    143     return *this;
    144 }
    145 
    146 Utf8Str& Utf8Str::toUpper()
    147 {
    148     if (!isEmpty())
    149         ::RTStrToUpper(m_psz);
    150     return *this;
    151 }
    152 
    153 void Utf8Str::stripTrailingSlash()
    154 {
    155     RTPathStripTrailingSlash(m_psz);
    156     jolt();
    157 }
    158 
    159 void Utf8Str::stripFilename()
    160 {
    161     RTPathStripFilename(m_psz);
    162     jolt();
    163 }
    164 
    165 void Utf8Str::stripExt()
    166 {
    167     RTPathStripExt(m_psz);
    168     jolt();
    169 }
    170 
    17197int Utf8Str::toInt(uint64_t &i) const
    17298{
    173     if (!m_psz)
     99    if (!str)
    174100        return VERR_NO_DIGITS;
    175     return RTStrToUInt64Ex(m_psz, NULL, 0, &i);
     101    return RTStrToUInt64Ex(str, NULL, 0, &i);
    176102}
    177103
    178104int Utf8Str::toInt(uint32_t &i) const
    179105{
    180     if (!m_psz)
     106    if (!str)
    181107        return VERR_NO_DIGITS;
    182     return RTStrToUInt32Ex(m_psz, NULL, 0, &i);
     108    return RTStrToUInt32Ex(str, NULL, 0, &i);
    183109}
    184110
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette