VirtualBox

Changeset 14922 in vbox for trunk/include


Ignore:
Timestamp:
Dec 2, 2008 5:39:34 PM (16 years ago)
Author:
vboxsync
Message:

Main: more XML reader implemenation.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

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

    r14917 r14922  
    794794        Key key = findKey (aName);
    795795        if (key.isNull())
    796             throw ENoKey (FmtStr ("No such key '%s'", aName));
     796        {
     797            throw ENoKey(FmtStr("No such key '%s'", aName));
     798        }
    797799        return key;
    798800    }
     
    10151017
    10161018    /**
    1017      * The Error class represents errors that may happen when parsing or
    1018      * validating the XML document representing the settings tree.
    1019      */
    1020     class VBOXXML_CLASS Error : public xml::RuntimeError
    1021     {
    1022     public:
    1023 
    1024         Error (const char *aMsg = NULL) : RuntimeError (aMsg) {}
    1025     };
    1026 
    1027     /**
    10281019     * The EConversionCycle class represents a conversion cycle detected by the
    10291020     * AutoConverter::needsConversion() implementation.
    10301021     */
    1031     class VBOXXML_CLASS EConversionCycle : public Error
     1022    class VBOXXML_CLASS EConversionCycle : public xml::RuntimeError
    10321023    {
    10331024    public:
    10341025
    1035         EConversionCycle (const char *aMsg = NULL) : Error (aMsg) {}
     1026        EConversionCycle (const char *aMsg = NULL) : RuntimeError (aMsg) {}
    10361027    };
    10371028
     
    11831174private:
    11841175
    1185     class XmlError;
    1186 
    11871176    /* Obscure class data */
    11881177    struct Data;
  • trunk/include/VBox/xml.h

    r14904 r14922  
    110110public:
    111111
    112     Error (const char *aMsg = NULL)
     112    Error(const char *aMsg = NULL)
    113113        : m (aMsg ? Str::New (aMsg) : NULL) {}
    114114
     
    120120
    121121private:
     122
     123    Error() {};     // hide the default constructor to make sure the extended one above is always used
    122124
    123125    /** smart string with support for reference counting */
     
    148150public:
    149151
    150     LogicError (const char *aMsg = NULL) : Error (aMsg) {}
     152    LogicError (const char *aMsg = NULL)
     153        : xml::Error(aMsg)
     154    {}
    151155
    152156    LogicError (RT_SRC_POS_DECL);
     
    158162
    159163    RuntimeError (const char *aMsg = NULL) : Error (aMsg) {}
     164};
     165
     166class VBOXXML_CLASS XmlError : public RuntimeError
     167{
     168public:
     169
     170    XmlError(xmlErrorPtr aErr);
     171
     172    static char *Format(xmlErrorPtr aErr);
    160173};
    161174
     
    194207public:
    195208
    196     EIPRTFailure (const char *aMsg = NULL) : RuntimeError (aMsg) {}
    197 
    198     EIPRTFailure (int aRC) : mRC (aRC) {}
     209    EIPRTFailure (int aRC);
     210
    199211    int rc() const { return mRC; }
    200212
    201213private:
    202 
    203214    int mRC;
    204215};
     
    466477    std::auto_ptr<Data> m;
    467478
     479    static int ReadCallback(void *aCtxt, char *aBuf, int aLen);
     480
     481    static int CloseCallback (void *aCtxt);
    468482};
    469483
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