cxxtools::xml::XmlIObject< ObjectType > Class Template Reference

Wrapper object to easily read objects as xml from a input stream. More...

#include <cxxtools/xml/xml.h>

Public Member Functions

 XmlIObject (ObjectType &object)
ObjectType & object ()
XmlIObjectreadAttributes (bool sw)
bool readAttributes ()
XmlIObjectattributePrefix (const String &p)
const StringattributePrefix ()

Detailed Description

template<typename ObjectType>
class cxxtools::xml::XmlIObject< ObjectType >

Wrapper object to easily read objects as xml from a input stream.

XmlIObject is a little wrapper which makes it easy to read objects from a istream. For this the XmlIObject expects a reference to the wrapped object and has a input operator for a std::istream, or actually a std::basic_istream, which reads the object from xml format.

Example:

std::vector<unsigned> v;
std::istringstream in(
\"<?xml version=\"1.0\" encoding=\"UTF-8\"?><rootnode><a>45</a><a>23</a></rootnode>");
for (unsigned n = 0; n < v.size(); ++n)
std::cout << v[n] << '\n'; // prints 45 and 23

Constructor & Destructor Documentation

template<typename ObjectType>
cxxtools::xml::XmlIObject< ObjectType >::XmlIObject ( ObjectType &  object)
inlineexplicit

Member Function Documentation

template<typename ObjectType>
XmlIObject& cxxtools::xml::XmlIObject< ObjectType >::attributePrefix ( const String p)
inline
template<typename ObjectType>
const String& cxxtools::xml::XmlIObject< ObjectType >::attributePrefix ( )
inline
template<typename ObjectType>
ObjectType& cxxtools::xml::XmlIObject< ObjectType >::object ( )
inline
template<typename ObjectType>
XmlIObject& cxxtools::xml::XmlIObject< ObjectType >::readAttributes ( bool  sw)
inline
template<typename ObjectType>
bool cxxtools::xml::XmlIObject< ObjectType >::readAttributes ( )
inline

The documentation for this class was generated from the following file:
  • include/cxxtools/xml/xml.h