Changeset 16538 in vbox for trunk/include/VBox
- Timestamp:
- Feb 5, 2009 11:25:01 PM (16 years ago)
- Location:
- trunk/include/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r16188 r16538 47 47 #include <VBox/xml.h> 48 48 49 #include <stdarg.h>49 // #include <stdarg.h> 50 50 51 51 … … 592 592 catch (const ENoValue &) 593 593 { 594 throw ENoValue( xml::FmtStr("No such attribute '%s'", aName));594 throw ENoValue(com::Utf8StrFmt("No such attribute '%s'", aName)); 595 595 } 596 596 } … … 647 647 catch (const ENoValue &) 648 648 { 649 throw ENoValue( xml::FmtStr("No value for attribute '%s'", aName));649 throw ENoValue(com::Utf8StrFmt("No value for attribute '%s'", aName)); 650 650 } 651 651 } … … 761 761 if (key.isNull()) 762 762 { 763 throw ENoKey( xml::FmtStr("No such key '%s'", aName));763 throw ENoKey(com::Utf8StrFmt("No such key '%s'", aName)); 764 764 } 765 765 return key; -
trunk/include/VBox/xml.h
r16325 r16538 101 101 { 102 102 103 // Helpers104 //////////////////////////////////////////////////////////////////////////////105 106 /**107 * Temporary holder for the formatted string.108 *109 * Instances of this class are used for passing the formatted string as an110 * argument to an Error constructor or to another function that takes111 * <tr>const char *</tr> and makes a copy of the string it points to.112 */113 class VBOXXML_CLASS FmtStr114 {115 public:116 117 /**118 * Creates a formatted string using the format string and a set of119 * 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 141 103 // Exceptions 142 104 //////////////////////////////////////////////////////////////////////////////
Note:
See TracChangeset
for help on using the changeset viewer.