Classes | |
class | Document |
Convenience interface to xml::document. More... | |
class | Exception |
Exception class for Dv::Xml classes and functions. More... | |
struct | noconst |
Utility template: noconst<T>::mutable_type is T if T is not "const" and X if T is "const X". More... | |
struct | noconst< const T > |
Utility template: noconst<T>::mutable_type is T if T is not "const" and X if T is "const X". More... | |
struct | noconst< T * > |
Utility template: noconst<T>::mutable_type is T if T is not "const" and X if T is "const X". More... | |
class | Node |
Convenience interface to xml::node. More... | |
Functions | |
void | iconv (const char *to_charset, const char *from_charset, std::string &target, const char *source) throw (std::runtime_error) |
Convert source C-string between character sets. | |
void | iconv (const char *to_charset, const char *from_charset, std::string &target, const std::string &source) throw (std::runtime_error) |
Convert source C-string between character sets. | |
std::string | iconv (const char *to_charset, const char *from_charset, const char *source) throw (std::runtime_error) |
Convert source C-string between character sets. | |
std::string | iconv (const char *to_charset, const char *from_charset, const std::string &source) throw (std::runtime_error) |
Convert source C-string between character sets. | |
std::string | iso2utf8 (const std::string &source) throw (std::runtime_error) |
Convert "ISO-8859-1" string to "UTF8" string. | |
std::string | iso2utf8 (const char *source) throw (std::runtime_error) |
Convert "ISO-8859-1" C-string to "UTF8" string. | |
std::ostream & | operator<< (std::ostream &os, const Node::Ref &ref) |
Print an XML tree rooted at the node referred to by a Dv::Xml::Node::Ref object. | |
Node::Ref | operator/ (const Node::Ref &ref, const std::string &name) throw (Exception) |
Retrieve child node with matching name. | |
bool | operator== (const Node::Ref &n, const Node::Ref &m) |
Equality test. | |
bool | operator!= (const Node::Ref m, const Node::Ref &n) |
Inequality test. | |
Node::Ref | operator>> (Node::Ref ref, const std::string &name) throw (Exception) |
Append new child node with given name. | |
Node::Ref | operator>> (Node::Ref ref, const char *name) throw (Exception) |
Append new child node with given name. | |
Node::Ref | operator>> (Node::Ref ref, Node::Ref child) throw (Exception) |
Append copy of node to children of this node. | |
std::ostream & | operator<< (std::ostream &os, const Node::AttributeReference &a) |
const char * | to_html (unsigned char c) throw () |
Convert to html representation. | |
std::string & | to_html (const std::string &sin, std::string &sout) throw () |
Convert string to html representation. | |
std::string | to_html (const std::string &sin) throw () |
Convert string to html representation. | |
Dv::Xml::Node | date (const std::string &name, const Dv::Util::Date &d) |
Represent date as xml::node. |
void Dv::Xml::iconv | ( | const char * | to_charset, | |
const char * | from_charset, | |||
std::string & | target, | |||
const char * | source | |||
) | throw (std::runtime_error) |
Convert source C-string between character sets.
to_charset | character set to convert to, e.g. "UTF8" | |
from_charset | character set to convert from, e.g. "ISO-8859-1" | |
target | string containing new version of source string. | |
source | C-string |
std::runtime_error | if anything goes wrong. Use iconv --list to see all supported character sets. |
Referenced by iso2utf8().
void Dv::Xml::iconv | ( | const char * | to_charset, | |
const char * | from_charset, | |||
std::string & | target, | |||
const std::string & | source | |||
) | throw (std::runtime_error) |
Convert source C-string between character sets.
to_charset | character set to convert to, e.g. "UTF8" | |
from_charset | character set to convert from, e.g. "ISO-8859-1" | |
target | string containing new version of source string. | |
source | C-string |
std::runtime_error | if anything goes wrong. Use iconv --list to see all supported character sets. |
std::string Dv::Xml::iconv | ( | const char * | to_charset, | |
const char * | from_charset, | |||
const char * | source | |||
) | throw (std::runtime_error) |
Convert source C-string between character sets.
to_charset | character set to convert to, e.g. "UTF8" | |
from_charset | character set to convert from, e.g. "ISO-8859-1" | |
source | C-string |
std::runtime_error | if anything goes wrong. Use iconv --list to see all supported character sets. |
std::string Dv::Xml::iconv | ( | const char * | to_charset, | |
const char * | from_charset, | |||
const std::string & | source | |||
) | throw (std::runtime_error) |
Convert source C-string between character sets.
to_charset | character set to convert to, e.g. "UTF8" | |
from_charset | character set to convert from, e.g. "ISO-8859-1" | |
source | C-string |
std::runtime_error | if anything goes wrong. Use iconv --list to see all supported character sets. |
std::string Dv::Xml::iso2utf8 | ( | const std::string & | source | ) | throw (std::runtime_error) [inline] |
Convert "ISO-8859-1" string to "UTF8" string.
source | string (using "ISO-8859-1" character set). |
std::runtime_error | if anything goes wrong. Use iconv --list to see all supported character sets. |
Definition at line 62 of file dviconv.h.
References iconv().
std::string Dv::Xml::iso2utf8 | ( | const char * | source | ) | throw (std::runtime_error) [inline] |
Convert "ISO-8859-1" C-string to "UTF8" string.
source | string (using "ISO-8859-1" character set). |
std::runtime_error | if anything goes wrong. Use iconv --list to see all supported character sets. |
Definition at line 72 of file dviconv.h.
References iconv().
std::ostream& Dv::Xml::operator<< | ( | std::ostream & | os, | |
const Node::Ref & | ref | |||
) |
Print an XML tree rooted at the node referred to by a Dv::Xml::Node::Ref object.
os | stream to print to | |
ref | reference to xml::node (may be invalid) |
Node::Ref Dv::Xml::operator/ | ( | const Node::Ref & | ref, | |
const std::string & | name | |||
) | throw (Exception) [inline] |
Retrieve child node with matching name.
ref | reference to xml::node of which child is to be found | |
name | to match in returned child node |
Dv::Xml::Exception | if this Dv::Xml::Node::Ref does not refer to a valid xml::node. |
Definition at line 581 of file node.h.
References Dv::Xml::Node::Ref::find(), Dv::Xml::Node::name(), and Dv::Xml::Node::ref().
bool Dv::Xml::operator== | ( | const Node::Ref & | n, | |
const Node::Ref & | m | |||
) | [inline] |
Equality test.
n | Dv::Xml::Node::Ref to compare with. | |
m | Dv::Xml::Node::Ref to compare with. |
Definition at line 590 of file node.h.
References Dv::Xml::Node::Ref::equals().
bool Dv::Xml::operator!= | ( | const Node::Ref | m, | |
const Node::Ref & | n | |||
) | [inline] |
Inequality test.
m | Dv::Xml::Node::Ref to compare with. | |
n | Dv::Xml::Node::Ref to compare with. |
Definition at line 600 of file node.h.
References Dv::Xml::Node::Ref::equals().
Node::Ref Dv::Xml::operator>> | ( | Node::Ref | ref, | |
const std::string & | name | |||
) | throw (Exception) [inline] |
Append new child node with given name.
ref | to node to which a new child node will be appended. | |
name | for new child node. |
Dv::Xml::Exception | if ref does not refer to a valid xml::node. |
Definition at line 612 of file node.h.
References Dv::Xml::Node::Ref::add(), Dv::Xml::Node::name(), and Dv::Xml::Node::ref().
Append new child node with given name.
ref | to node to which a new child node will be appended. | |
name | for new child node. |
Dv::Xml::Exception | if ref does not refer to a valid xml::node. |
Definition at line 624 of file node.h.
References Dv::Xml::Node::Ref::add(), Dv::Xml::Node::name(), and Dv::Xml::Node::ref().
Append copy of node to children of this node.
ref | reference to xml::node to which a child will be added. | |
child | a copy of which will be added to the children of this node. |
Dv::Xml::Exception | if either of the parameters does not refer to a valid xml::node. |
Definition at line 635 of file node.h.
References Dv::Xml::Node::Ref::add(), and Dv::Xml::Node::ref().
std::ostream& Dv::Xml::operator<< | ( | std::ostream & | os, | |
const Node::AttributeReference & | a | |||
) | [inline] |
const char* Dv::Xml::to_html | ( | unsigned char | c | ) | throw () |
Convert to html representation.
E.g. '&' becomes '&' etc.
c | char to convert |
std::string& Dv::Xml::to_html | ( | const std::string & | sin, | |
std::string & | sout | |||
) | throw () |
Convert string to html representation.
E.g. '&' becomes '&' etc.
sin | string to convert. | |
sout | string to which result of conversion will be appended. |
std::string Dv::Xml::to_html | ( | const std::string & | sin | ) | throw () |
Convert string to html representation.
E.g. '&' becomes '&' etc.
sin | string to convert. |
Dv::Xml::Node Dv::Xml::date | ( | const std::string & | name, | |
const Dv::Util::Date & | d | |||
) |
Represent date as xml::node.
name | tag of main xml::node. | |
d | date to represent. |
dvxml-0.1.7 | [ 7 January, 2008] |