12 #include <vapor/MyBase.h>
14 #pragma warning(disable : 4251)
66 const string &tag,
const map<string, string> &attrs,
67 size_t numChildrenHint = 0
71 size_t numChildrenHint = 0
75 const string &tag,
const map<string, string> &attrs,
76 size_t numChildrenHint = 0
77 ) {
return(
new XmlNode( tag, attrs, numChildrenHint)); }
95 string &
Tag() {
return (_tag); }
101 map <string, string> &
Attrs() {
return (_attrmap); }
127 virtual int SetElementLong(
128 const vector<string> &tags,
const vector<long> &values
141 virtual int SetElementLong(
142 const string &tag,
const vector<long> &values
155 virtual const vector<long> &GetElementLong(
const string &tag)
const;
164 virtual int HasElementLong(
const string &tag)
const;
177 virtual int SetElementDouble(
178 const string &tag,
const vector<double> &values
192 virtual int SetElementDouble(
193 const vector<string> &tags,
const vector<double> &values
206 virtual const vector<double> &GetElementDouble(
const string &tag)
const;
214 virtual int HasElementDouble(
const string &tag)
const;
228 virtual int SetElementString(
const string &tag,
const string &values);
241 virtual const string &GetElementString(
const string &tag)
const;
257 virtual int SetElementStringVec(
258 const string &tag,
const vector <string> &values
274 virtual int SetElementStringVec(
275 const vector<string> &tagpath,
const vector <string> &values
291 virtual void GetElementStringVec(
const string &tag, vector <string> &vec)
const;
299 virtual int HasElementString(
const string &tag)
const;
319 virtual void AddChild(
339 const string &tag,
const map <string, string> &attrs,
340 size_t numChildrenHint = 0
352 virtual int DeleteChild(
size_t index);
353 virtual int DeleteChild(
const string &tag);
358 virtual void DeleteAll();
388 virtual XmlNode *GetChild(
size_t index)
const;
404 virtual int HasChild(
size_t index);
414 virtual XmlNode *GetChild(
const string &tag)
const;
433 virtual int HasChild(
const string &tag);
437 friend ostream& operator<<(ostream &s,
const XmlNode& node);
441 static ostream& streamOut(ostream& os,
const XmlNode& node);
447 static string replaceAll(
const string& sourceString,
const char* input,
const char* output);
460 static string replacement;
464 map <string, string> _attrmap;
465 vector <XmlNode *> _children;
475 void _deleteChildren(
XmlNode *node);
481 #endif // _XmlNode_h_
map< string, string > & Attrs()
virtual XmlNode * GetParent()
map< string, vector< long > > _longmap
static vector< long > _emptyLongVec
map< string, string > _stringmap
static string _emptyString
virtual XmlNode * Clone()
static vector< string > _emptyStringVec
virtual int GetNumChildren() const
virtual bool & ErrOnMissing()
virtual void ClearChildren()
static vector< double > _emptyDoubleVec
virtual XmlNode * Construct(const string &tag, const map< string, string > &attrs, size_t numChildrenHint=0)
map< string, vector< double > > _doublemap