#include <xmlminus.h>
Public Types | |
typedef T | string_type |
The string type. | |
typedef T::value_type | char_type |
The character type of the string type. | |
typedef T::traits_type | traits_type |
The char traits type of the string type. | |
typedef std::basic_istream< char_type, traits_type > | istream_type |
An input stream type to use with this type of element. | |
typedef std::basic_ostream< char_type, traits_type > | ostream_type |
An input output type to use with this type of element. | |
typedef std::vector< BasicElement< T > > | ChildVector |
A vector of elements. | |
Public Member Functions | |
BasicDocument (istream_type &in) | |
Create and parse a new XML document. | |
BasicDocument (istream_type &in, const std::locale &loc) | |
Create and parse a new XML document. | |
BasicDocument (const std::string &filename) | |
Create and parse a new XML element from a file. | |
BasicDocument (const std::string &filename, const std::locale &loc) | |
Create and parse a new XML element from a file. | |
BasicDocument (const std::locale &locale) | |
Create a new document with one empty element. | |
BasicDocument () | |
Create a new document with one empty element. | |
std::locale & | getLocale () |
Get this document's locale. | |
const std::locale & | getLocale () const |
Get this document's locale. | |
BasicElement< T > & | getRootElement () |
Get this document's root element. | |
const BasicElement< T > & | getRootElement () const |
Get this document's root element. | |
const ChildVector & | getChildren () const |
Get this document's child elements. | |
ChildVector & | getChildren () |
Get this document's child elements. | |
void | parse (istream_type &in) |
Read and parse this document from a stream. | |
void | print (ostream_type &out) const |
Write this document to an output stream. |
T | the string type for this document |
xmlm::BasicDocument< T >::BasicDocument | ( | istream_type & | in | ) | [inline] |
Create and parse a new XML document.
This document's locale will be queried from the input stream.
in | the input stream where to read the XML data |
ParseError | on parsing/syntax errors | |
std::runtime_error | on I/O errors |
xmlm::BasicDocument< T >::BasicDocument | ( | istream_type & | in, | |
const std::locale & | loc | |||
) | [inline] |
Create and parse a new XML document.
The locale will be imbue'd to the input stream and the previous locale will be restored after the parsing.
in | the input stream where to read the XML | |
loc | the locale to use |
ParseError | on parsing/syntax errors | |
std::runtime_error | on I/O errors |
xmlm::BasicDocument< T >::BasicDocument | ( | const std::string & | filename | ) | [inline] |
Create and parse a new XML element from a file.
This document's locale will be queried from the input stream.
filename | the filename of the file from where to read the XML |
ParseError | on parsing/syntax errors | |
std::runtime_error | on I/O errors |
xmlm::BasicDocument< T >::BasicDocument | ( | const std::string & | filename, | |
const std::locale & | loc | |||
) | [inline] |
Create and parse a new XML element from a file.
The locale will be imbue'd to the input stream and the previous locale will be restored after the parsing.
filename | the filename of the file from where to read the XML | |
loc | the locale to use |
ParseError | on parsing/syntax errors | |
std::runtime_error | on I/O errors |
xmlm::BasicDocument< T >::BasicDocument | ( | const std::locale & | locale | ) | [inline] |
Create a new document with one empty element.
locale | the locale to use |
std::locale& xmlm::BasicDocument< T >::getLocale | ( | ) | [inline] |
Get this document's locale.
const std::locale& xmlm::BasicDocument< T >::getLocale | ( | ) | const [inline] |
Get this document's locale.
BasicElement<T>& xmlm::BasicDocument< T >::getRootElement | ( | ) | [inline] |
Get this document's root element.
ParseError | if there's no root element in this document |
const BasicElement<T>& xmlm::BasicDocument< T >::getRootElement | ( | ) | const [inline] |
Get this document's root element.
ParseError | if there's no root element in this document |
const ChildVector& xmlm::BasicDocument< T >::getChildren | ( | ) | const [inline] |
Get this document's child elements.
ChildVector& xmlm::BasicDocument< T >::getChildren | ( | ) | [inline] |
Get this document's child elements.
void xmlm::BasicDocument< T >::parse | ( | istream_type & | in | ) |
Read and parse this document from a stream.
in | the input stream where to parse this document from |
ParseError | on parsing errors | |
std::runtime_error | on I/O errors |
void xmlm::BasicDocument< T >::print | ( | ostream_type & | out | ) | const |
Write this document to an output stream.
Writes out this element and all it's subelements recursively.
out | the output stream where to write this element |