XMLDocument Class Reference
An object representing an XML document.
More...
#include <XMLDocument.h++>
List of all members.
Classes |
| class | XMLParser |
Public Member Functions |
| | XMLDocument (const String &encoding="us-ascii") |
| | Construct a new XMLDocument with the given character encoding.
|
| | ~XMLDocument () throw () |
| | Destructor.
|
| XMLElement & | getRoot () |
| | Get the root element of the document.
|
| const XMLElement & | getRoot () const |
| | Get the root element of the document.
|
| XMLElement & | setRoot (const String &name) throw (InvalidArgumentException) |
| | Set the root element of the document.
|
| XMLElement & | find (const String &path) throw (InvalidArgumentException) |
| | Find an XML element via a path.
|
| const XMLElement & | find (const String &path) const throw (InvalidArgumentException) |
| | Find an XML element via a path.
|
| void | read (std::istream &stream) throw (ParseException, IOException) |
| | Read and parse the XML document from a stream.
|
| void | read (const String &str) throw (ParseException) |
| | Read and parse the XML document from a String.
|
| void | write (std::ostream &stream, uint_t tabWidth=2) const throw (IOException) |
| | Format and write the XML document to a stream.
|
| void | write (String &str, uint_t tabWidth=2) const |
| | Format and write the XML document to a String.
|
| bool | isEmpty () const throw () |
| | Test if the document is empty.
|
| bool | operator! () const throw () |
| | Test if the document is empty.
|
Detailed Description
An object representing an XML document.
- Author:
- Mark Lindner
Constructor & Destructor Documentation
Construct a new XMLDocument with the given character encoding.
- Parameters:
-
Member Function Documentation
Find an XML element via a path.
- Parameters:
-
| path | The path, a dot- or slash-separated list of element names beginning with the root element. |
- Returns:
- The first matching element, if found, otherwise XMLElement::null.
- Exceptions:
-
Find an XML element via a path.
- Parameters:
-
| path | The path, a dot- or slash-separated list of element names beginning with the root element. |
- Returns:
- The first matching element, if found, otherwise XMLElement::null.
- Exceptions:
-
Get the root element of the document.
- Returns:
- A reference to the root element, or XMLElement::null if the document is empty.
Get the root element of the document.
- Returns:
- A reference to the root element, or XMLElement::null if the document is empty.
| bool isEmpty |
( |
|
) |
const throw () [inline] |
Test if the document is empty.
- Returns:
- true if the document is empty, false otherwise.
| bool operator! |
( |
|
) |
const throw () [inline] |
Test if the document is empty.
- Returns:
- true if the document is empty, false otherwise.
Read and parse the XML document from a String.
- Parameters:
-
| str | The String to read from. |
- Exceptions:
-
Read and parse the XML document from a stream.
- Parameters:
-
| stream | The stream to read from. |
- Exceptions:
-
Set the root element of the document.
The previous content of the document is deleted.
- Parameters:
-
| name | The name for the new element. |
- Returns:
- A reference to the new element.
- Exceptions:
-
Format and write the XML document to a String.
- Parameters:
-
| str | The String to write to. |
| tabWidth | The tab width for indentation; a value of 0 disables pretty-printing. |
Format and write the XML document to a stream.
- Parameters:
-
| stream | The stream to write to. |
| tabWidth | The tab width for indentation; a value of 0 disables pretty-printing. |
- Exceptions:
-
The documentation for this class was generated from the following files: