VirtualBox

Changeset 16538 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Feb 5, 2009 11:25:01 PM (16 years ago)
Author:
vboxsync
Message:

Main: replace redundant xml::FmtStr with com::Utf8StrFmt

Location:
trunk/include/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r16188 r16538  
    4747#include <VBox/xml.h>
    4848
    49 #include <stdarg.h>
     49// #include <stdarg.h>
    5050
    5151
     
    592592        catch (const ENoValue &)
    593593        {
    594             throw ENoValue(xml::FmtStr("No such attribute '%s'", aName));
     594            throw ENoValue(com::Utf8StrFmt("No such attribute '%s'", aName));
    595595        }
    596596    }
     
    647647        catch (const ENoValue &)
    648648        {
    649             throw ENoValue(xml::FmtStr("No value for attribute '%s'", aName));
     649            throw ENoValue(com::Utf8StrFmt("No value for attribute '%s'", aName));
    650650        }
    651651    }
     
    761761        if (key.isNull())
    762762        {
    763             throw ENoKey(xml::FmtStr("No such key '%s'", aName));
     763            throw ENoKey(com::Utf8StrFmt("No such key '%s'", aName));
    764764        }
    765765        return key;
  • trunk/include/VBox/xml.h

    r16325 r16538  
    101101{
    102102
    103 // Helpers
    104 //////////////////////////////////////////////////////////////////////////////
    105 
    106 /**
    107  * Temporary holder for the formatted string.
    108  *
    109  * Instances of this class are used for passing the formatted string as an
    110  * argument to an Error constructor or to another function that takes
    111  * <tr>const char *</tr> and makes a copy of the string it points to.
    112  */
    113 class VBOXXML_CLASS FmtStr
    114 {
    115 public:
    116 
    117     /**
    118      * Creates a formatted string using the format string and a set of
    119      * printf-like arguments.
    120      */
    121     FmtStr(const char *aFmt, ...)
    122     {
    123         va_list args;
    124         va_start(args, aFmt);
    125         RTStrAPrintfV(&mStr, aFmt, args);
    126         va_end(args);
    127     }
    128 
    129     ~FmtStr() { RTStrFree (mStr); }
    130 
    131     operator const char *() { return mStr; }
    132 
    133 private:
    134 
    135     DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (FmtStr)
    136 
    137     char *mStr;
    138 };
    139 
    140 
    141103// Exceptions
    142104//////////////////////////////////////////////////////////////////////////////
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