34 #include <Base/Common/XMLIO.hh>
35 #include <Base/Debug/Debug.hh>
36 #include <Base/Common/XMLBase.hh>
43 #define VERSIONOFTESTCLASS 0.37
48 virtual int XMLGetClassName(
string& TopLevelTag,
double& Version)
const;
49 virtual int XMLOut(
const xmlNodePtr Node,
XMLIO& XMLObject)
const;
50 virtual int XMLIn(
const xmlNodePtr Node,
XMLIO& XMLObject);
51 virtual ~myTestClass();
57 myTestClass::~myTestClass() {}
59 int myTestClass::XMLGetClassName(std::string& TopLevelTag,
60 double &Version)
const {
61 TopLevelTag =
"myTestClass";
62 Version = VERSIONOFTESTCLASS;
66 int myTestClass::XMLOut(
const xmlNodePtr Node,
XMLIO& XMLObject)
const {
72 int myTestClass::XMLIn(
const xmlNodePtr Node,
XMLIO& XMLObject) {
79 int main (
int ,
char ** )
84 x.XMLWrite(
"backupofx.xml");
86 x.XMLWriteToString(str);
87 cout <<
"xml in string:\n" << str << endl;
89 y.XMLRead(
"backupofx.xml");
90 z.XMLReadFromString(str);
93 if (x.thedata == y.thedata && x.thedata == z.thedata)
99 <<
"x.thedata="<<x.thedata<<endl
100 <<
"y.thedata="<<y.thedata <<endl
101 <<
"z.thedata="<<z.thedata <<endl
102 <<
"result="<<result<<endl;
void addAttribute(const xmlNodePtr Node, const std::string &AttributeName, bool AttributeValue)
Add an attribute to a node.
int getAttributeValueInt(const xmlAttrPtr Attribute) const
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
Base class with interface for xml output.