1 // XML.h:structure definitions for SourceSafe files
3 //////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_XML_H__6602C07F_65ED_4FD7_A730_6D416805378A__INCLUDED_)
6 #define AFX_XML_H__6602C07F_65ED_4FD7_A730_6D416805378A__INCLUDED_
10 #endif // _MSC_VER > 1000
13 #include <boost/lexical_cast.hpp>
15 typedef std::map
<std::string
, std::string
> AttribMap
;
19 // ---------------------------------------------------------------
20 class XMLNode
// : protected XMLEntity
23 XMLNode (XMLNode
* pParent
, std::string name
, AttribMap attrib
);
26 XMLNode (XMLNode
* pParent
, std::string name
, const T
& element
)
27 : m_Node (name
), m_pParent (pParent
)
29 SetText (boost::lexical_cast
<std::string
>(element
));
33 XMLNode (XMLNode
* pParent
, std::string name
, AttribMap attrib
, const T
& element
)
34 : m_Node (name
), m_pParent (pParent
)
36 SetAttributes (attrib
);
37 SetText (boost::lexical_cast
<std::string
>(element
));
42 void AddChild (XMLNode
* pChild
);
43 void AddText (XMLText
* pContent
);
45 void SetAttributes (AttribMap attrib
);
46 void SetText (std::string text
);
54 class XMLElement
: public XMLNode
58 XMLElement (XMLNode
* pParent
, std::string name
, const T
& element
)
59 : XMLNode (pParent
, name
, element
)
64 XMLElement (XMLNode
* pParent
, std::string name
, AttribMap attrib
, const T
& element
)
65 : XMLNode (pParent
, name
, attrib
, element
)
70 class XMLText
// : protected XMLEntity
74 XMLText (XMLNode
* pParent
, const T
& element
)
75 : m_Text (""), m_pParent (pParent
)
77 SetValue (boost::lexical_cast
<std::string
>(element
));
82 void SetValue (std::string value
);
89 #endif // !defined(AFX_XML_H__6602C07F_65ED_4FD7_A730_6D416805378A__INCLUDED_)