Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

void ConfigFileBase::parseUUID ( com::Guid guid,
const com::Utf8Str strUUID 
) const [protected]

Helper function that parses a UUID in string form into a com::Guid item. Since that uses an IPRT function which does not accept "{}" characters around the UUID string, we handle that here. Throws on errors.


Definition at line 324 of file Settings.cpp.

References iprt::MiniString::c_str(), com::Guid::isEmpty(), N_, NULL, and iprt::MiniString::substr().

    // {5f102a55-a51b-48e3-b45a-b28d33469488}
    // 01234567890123456789012345678901234567
    //           1         2         3
    if (    (strUUID[0] == '{')
         && (strUUID[37] == '}')
        guid = strUUID.substr(1, 36).c_str();
        guid = strUUID.c_str();

    if (guid.isEmpty())
        throw ConfigFileError(this, NULL, N_("UUID \"%s\" has invalid format"), strUUID.c_str());

Generated by  Doxygen 1.6.0   Back to index