VirtualBox

Changeset 36527 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Apr 4, 2011 1:16:09 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70949
Message:

iprt::MiniString -> RTCString.

Location:
trunk/src/VBox/Main/src-all
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp

    r35934 r36527  
    242242    m->pVirtualBox                  = a_pVirtualBox;
    243243
    244     iprt::MiniString *pstrTarName = VBoxExtPackExtractNameFromTarballPath(a_pszFile);
     244    RTCString *pstrTarName = VBoxExtPackExtractNameFromTarballPath(a_pszFile);
    245245    if (pstrTarName)
    246246    {
     
    284284     * Parse the XML.
    285285     */
    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);
    288288    RTVfsFileRelease(hXmlFile);
    289289    if (pStrLoadErr != NULL)
     
    12251225     * Read the description file.
    12261226     */
    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);
    12291229    if (pStrLoadErr != NULL)
    12301230    {
     
    19031903                if (RT_SUCCESS(vrc))
    19041904                {
    1905                     iprt::MiniString *pstrName = VBoxExtPackUnmangleName(Entry.szName, RTSTR_MAX);
     1905                    RTCString *pstrName = VBoxExtPackUnmangleName(Entry.szName, RTSTR_MAX);
    19061906                    AssertLogRel(pstrName);
    19071907                    if (pstrName)
     
    25632563{
    25642564    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;
    25672567
    25682568    AutoCaller autoCaller(this);
  • trunk/src/VBox/Main/src-all/ExtPackUtil.cpp

    r35523 r36527  
    4747 *                              (RTMemFree it even on failure)
    4848 */
    49 static iprt::MiniString *
     49static RTCString *
    5050vboxExtPackLoadPlugInDescs(const xml::ElementNode *pVBoxExtPackElm,
    5151                           uint32_t *pcPlugIns, PVBOXEXTPACKPLUGINDESC *paPlugIns)
     
    9898 * @param   a_pExtPackDesc      Where to store the extension pack descriptor.
    9999 */
    100 static iprt::MiniString *vboxExtPackLoadDescFromDoc(xml::Document *a_pDoc, PVBOXEXTPACKDESC a_pExtPackDesc)
     100static RTCString *vboxExtPackLoadDescFromDoc(xml::Document *a_pDoc, PVBOXEXTPACKDESC a_pExtPackDesc)
    101101{
    102102    /*
     
    106106    if (   !pVBoxExtPackElm
    107107        || 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;
    111111    if (!pVBoxExtPackElm->getAttributeValue("version", strFormatVersion))
    112         return new iprt::MiniString("Missing format version");
     112        return new RTCString("Missing format version");
    113113    if (!strFormatVersion.equals("1.0"))
    114         return &(new iprt::MiniString("Unsupported format version: "))->append(strFormatVersion);
     114        return &(new RTCString("Unsupported format version: "))->append(strFormatVersion);
    115115
    116116    /*
     
    119119    const xml::ElementNode *pNameElm = pVBoxExtPackElm->findChildElement("Name");
    120120    if (!pNameElm)
    121         return new iprt::MiniString("The 'Name' element is missing");
     121        return new RTCString("The 'Name' element is missing");
    122122    const char *pszName = pNameElm->getValue();
    123123    if (!VBoxExtPackIsValidName(pszName))
    124         return &(new iprt::MiniString("Invalid name: "))->append(pszName);
     124        return &(new RTCString("Invalid name: "))->append(pszName);
    125125
    126126    const xml::ElementNode *pDescElm = pVBoxExtPackElm->findChildElement("Description");
    127127    if (!pDescElm)
    128         return new iprt::MiniString("The 'Description' element is missing");
     128        return new RTCString("The 'Description' element is missing");
    129129    const char *pszDesc = pDescElm->getValue();
    130130    if (!pszDesc || *pszDesc == '\0')
    131         return new iprt::MiniString("The 'Description' element is empty");
     131        return new RTCString("The 'Description' element is empty");
    132132    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");
    134134
    135135    const xml::ElementNode *pVersionElm = pVBoxExtPackElm->findChildElement("Version");
    136136    if (!pVersionElm)
    137         return new iprt::MiniString("The 'Version' element is missing");
     137        return new RTCString("The 'Version' element is missing");
    138138    const char *pszVersion = pVersionElm->getValue();
    139139    if (!pszVersion || *pszVersion == '\0')
    140         return new iprt::MiniString("The 'Version' element is empty");
     140        return new RTCString("The 'Version' element is empty");
    141141    if (!VBoxExtPackIsValidVersionString(pszVersion))
    142         return &(new iprt::MiniString("Invalid version string: "))->append(pszVersion);
     142        return &(new RTCString("Invalid version string: "))->append(pszVersion);
    143143
    144144    uint32_t uRevision;
     
    148148    const xml::ElementNode *pMainModuleElm = pVBoxExtPackElm->findChildElement("MainModule");
    149149    if (!pMainModuleElm)
    150         return new iprt::MiniString("The 'MainModule' element is missing");
     150        return new RTCString("The 'MainModule' element is missing");
    151151    const char *pszMainModule = pMainModuleElm->getValue();
    152152    if (!pszMainModule || *pszMainModule == '\0')
    153         return new iprt::MiniString("The 'MainModule' element is empty");
     153        return new RTCString("The 'MainModule' element is empty");
    154154    if (!VBoxExtPackIsValidModuleString(pszMainModule))
    155         return &(new iprt::MiniString("Invalid main module string: "))->append(pszMainModule);
     155        return &(new RTCString("Invalid main module string: "))->append(pszMainModule);
    156156
    157157    /*
     
    167167            pszVrdeModule = NULL;
    168168        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);
    170170    }
    171171
     
    181181    uint32_t                cPlugIns  = 0;
    182182    PVBOXEXTPACKPLUGINDESC  paPlugIns = NULL;
    183     iprt::MiniString *pstrRet = vboxExtPackLoadPlugInDescs(pVBoxExtPackElm, &cPlugIns, &paPlugIns);
     183    RTCString *pstrRet = vboxExtPackLoadPlugInDescs(pVBoxExtPackElm, &cPlugIns, &paPlugIns);
    184184    if (pstrRet)
    185185    {
     
    214214 *                          attribs). Optional.
    215215 */
    216 iprt::MiniString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo)
     216RTCString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo)
    217217{
    218218    vboxExtPackClearDesc(a_pExtPackDesc);
     
    224224    int vrc = RTPathJoin(szFilePath, sizeof(szFilePath), a_pszDir, VBOX_EXTPACK_DESCRIPTION_NAME);
    225225    if (RT_FAILURE(vrc))
    226         return new iprt::MiniString("RTPathJoin failed with %Rrc", vrc);
     226        return new RTCString("RTPathJoin failed with %Rrc", vrc);
    227227
    228228    RTFSOBJINFO ObjInfo;
    229229    vrc = RTPathQueryInfoEx(szFilePath, &ObjInfo,  RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK);
    230230    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);
    232232    if (a_pObjInfo)
    233233        *a_pObjInfo = ObjInfo;
     
    235235    {
    236236        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);
    239239    }
    240240
     
    248248        catch (xml::XmlError Err)
    249249        {
    250             return new iprt::MiniString(Err.what());
     250            return new RTCString(Err.what());
    251251        }
    252252    }
     
    268268 *                          attribs). Optional.
    269269 */
    270 iprt::MiniString *VBoxExtPackLoadDescFromVfsFile(RTVFSFILE hVfsFile, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo)
     270RTCString *VBoxExtPackLoadDescFromVfsFile(RTVFSFILE hVfsFile, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo)
    271271{
    272272    vboxExtPackClearDesc(a_pExtPackDesc);
     
    278278    int rc = RTVfsFileQueryInfo(hVfsFile, &ObjInfo, RTFSOBJATTRADD_UNIX);
    279279    if (RT_FAILURE(rc))
    280         return &(new iprt::MiniString)->printf("RTVfsFileQueryInfo failed: %Rrc", rc);
     280        return &(new RTCString)->printf("RTVfsFileQueryInfo failed: %Rrc", rc);
    281281    if (a_pObjInfo)
    282282        *a_pObjInfo = ObjInfo;
     
    289289    /* Check the file size. */
    290290    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);
    292292    size_t const cbFile = (size_t)ObjInfo.cbObject;
    293293
     
    295295    rc = RTVfsFileSeek(hVfsFile, 0, RTFILE_SEEK_BEGIN, NULL);
    296296    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);
    298298
    299299    /* Allocate memory and read the file content into it. */
    300300    void *pvFile = RTMemTmpAlloc(cbFile);
    301301    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;
    305305    rc = RTVfsFileRead(hVfsFile, pvFile, cbFile, NULL);
    306306    if (RT_FAILURE(rc))
    307         pstrErr = &(new iprt::MiniString)->printf("RTVfsFileRead failed: %Rrc", rc);
     307        pstrErr = &(new RTCString)->printf("RTVfsFileRead failed: %Rrc", rc);
    308308
    309309    /*
     
    314314    {
    315315        xml::XmlMemParser   Parser;
    316         iprt::MiniString    strFileName = VBOX_EXTPACK_DESCRIPTION_NAME;
     316        RTCString    strFileName = VBOX_EXTPACK_DESCRIPTION_NAME;
    317317        try
    318318        {
     
    321321        catch (xml::XmlError Err)
    322322        {
    323             pstrErr = new iprt::MiniString(Err.what());
     323            pstrErr = new RTCString(Err.what());
    324324            rc = VERR_PARSE_ERROR;
    325325        }
     
    366366 * @param   pszTarball          The path to the tarball.
    367367 */
    368 iprt::MiniString *VBoxExtPackExtractNameFromTarballPath(const char *pszTarball)
     368RTCString *VBoxExtPackExtractNameFromTarballPath(const char *pszTarball)
    369369{
    370370    /*
     
    470470 * @sa      VBoxExtPackUnmangleName, VBoxExtPackIsValidMangledName
    471471 */
    472 iprt::MiniString *VBoxExtPackMangleName(const char *pszName)
     472RTCString *VBoxExtPackMangleName(const char *pszName)
    473473{
    474474    AssertReturn(VBoxExtPackIsValidName(pszName), NULL);
     
    486486    Assert(VBoxExtPackIsValidMangledName(szTmp));
    487487
    488     return new iprt::MiniString(szTmp, off);
     488    return new RTCString(szTmp, off);
    489489}
    490490
     
    498498 * @sa      VBoxExtPackMangleName, VBoxExtPackIsValidMangledName
    499499 */
    500 iprt::MiniString *VBoxExtPackUnmangleName(const char *pszMangledName, size_t cchMax)
     500RTCString *VBoxExtPackUnmangleName(const char *pszMangledName, size_t cchMax)
    501501{
    502502    AssertReturn(VBoxExtPackIsValidMangledName(pszMangledName, cchMax), NULL);
     
    517517    AssertReturn(VBoxExtPackIsValidName(szTmp), NULL);
    518518
    519     return new iprt::MiniString(szTmp, off);
     519    return new RTCString(szTmp, off);
    520520}
    521521
     
    535535    AssertReturn(VBoxExtPackIsValidName(pszName), VERR_INTERNAL_ERROR_5);
    536536
    537     iprt::MiniString *pstrMangledName = VBoxExtPackMangleName(pszName);
     537    RTCString *pstrMangledName = VBoxExtPackMangleName(pszName);
    538538    if (!pstrMangledName)
    539539        return VERR_INTERNAL_ERROR_4;
     
    665665     */
    666666    VBOXEXTPACKDESC     ExtPackDesc;
    667     iprt::MiniString   *pstrErr = VBoxExtPackLoadDescFromVfsFile(hXmlFile, &ExtPackDesc, NULL);
     667    RTCString   *pstrErr = VBoxExtPackLoadDescFromVfsFile(hXmlFile, &ExtPackDesc, NULL);
    668668    if (pstrErr)
    669669    {
Note: See TracChangeset for help on using the changeset viewer.

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