|
| XML () |
|
| XML (const String &v) |
|
| XML (const double &v) |
|
| XML (float v) |
|
| XML (int v) |
|
| XML (Type tagType, const String &name, const AttributeTable &at, const Array< XML > &ch=Array< XML >()) |
|
| XML (Type tagType, const String &name, const Array< XML > &ch=Array< XML >()) |
|
| XML (TextInput &t) |
|
const AttributeTable & | attributeTable () const |
|
bool | boolean () const |
| Returns false if a TAG. More...
|
|
const Array< XML > & | childArray () const |
|
bool | containsAttribute (const String &k) const |
|
void | deserialize (TextInput &t) |
|
XML | get (const String &k, const XML &defaultVal) const |
| Note that the result is always copied, making this inefficient for return values that are not VALUEs. More...
|
|
void | load (const String &filename) |
|
const String | name () const |
| The name, if this is a TAG. More...
|
|
size_t | numAttributes () const |
| Attribute table size; zero for a TAG. More...
|
|
double | number () const |
| Parse as a number. More...
|
|
int | numChildren () const |
| Array size; zero for a VALUE. More...
|
|
| operator bool () const |
|
| operator double () const |
|
| operator float () const |
|
| operator int () const |
|
| operator String () const |
|
const XML & | operator[] (int i) const |
| Return child i. More...
|
|
const XML & | operator[] (const String &k) const |
| Return the attribute with this name. More...
|
|
void | parse (const String &s) |
|
void | save (const String &filename, bool collapseEmptyTags=false) const |
|
void | serialize (TextOutput &t, bool collapseEmptyTags=false) const |
|
const String & | string () const |
| Returns "" if a TAG. More...
|
|
Type | type () const |
|
void | unparse (String &s, bool collapseEmptyTags=false) const |
| If collapseEmptyTags, writes tags with no children as a single tag. More...
|
|
const String & | value () const |
|
Easy loading and saving of XML and HTML files.
The XML class is intended primarily for interchange with other programs. We recommend using G3D::Any to make your own human-readable formats because it is a more general syntax, the implementation is more efficient, and contains better error handling.
Every XML is either a VALUE, or a TAG that contains both a table of its XML attributes and an array of its children. Children are nested tags and the strings between the nested tags.
No validation is performed, and the XML must be completely legal. XML Entity references (e.g., the ampersand codes for greater than and less than) are not automatically converted.
Tags with names that begin with "!" or "?" are ignored. Comment tags must end with "-->" e.g.,
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE note SYSTEM "Note.dtd">
<!-- a comment -->
- See also
- G3D::Any, http://www.grinninglizard.com/tinyxml/
<foo key0="value0" key1="value1">
child0 ...
<child1>...