class XmlDocument

Xml Document. More...

Full nameTelEngine::XmlDocument
Definition#include <libs/yxml/yatexml.h>
InheritsTelEngine::XmlParent [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

Xml Document

 XmlDocument ()

XmlDocument

The Constructor

 ~XmlDocument ()

~XmlDocument

[virtual]

Destructor

XmlDocument*  document ()

document

[virtual]

Get an Xml Document

Returns: This

Reimplemented from XmlParent.

XmlSaxParser::Error  addChild (XmlChild* child)

addChild

[virtual]

Append a new child to this document. Set the root to an XML element if not already set. If we already have a completed root the element will be added to the root, otherwise an error will be returned. If we don't have a root non xml elements (other then text) will be added the list of elements before root

Parameters:
childThe child to append

Returns: An error code if an error was detected

Reimplemented from XmlParent.

XmlDeclaration*  declaration ()

declaration

[const]

Retrieve the document declaration

Returns: XmlDeclaration pointer or 0 if not found

XmlElement*  root (bool completed = false)

root

[const]

Retrieve the root element

Parameters:
completedTrue to retrieve the root element if is not completed

Returns: Root pointer or 0 if not found or is not completed

void  reset ()

reset

[virtual]

Reset this Xml Document

Reimplemented from XmlParent.

XmlChild*  removeChild (XmlChild* child, bool delObj = true)

removeChild

[virtual]

Remove a child

Parameters:
childThe child to remove
delObjTrue to delete the object

Returns: XmlChild pointer if found and not deleted

Reimplemented from XmlParent.

XmlSaxParser::Error  read (Stream& in, int* error = 0)

read

[virtual]

Load this document from data stream and parse it.

Parameters:
inThe input stream
errorOptional pointer to data to be filled with error if IOError is returned

Returns: Parser error (NoError on success)

int  write (Stream& out, bool escape = true, const String& indent = String::empty(), const String& origIndent = String::empty(), bool completeOnly = true)

write

[const virtual]

Write this document to a data stream. A indent + n * origIndent will be added before each xml child, where n is the imbrication level, starting with 0. A indent + (n + 1) * origIndent will be added before each attribute

Parameters:
outThe output stream
escapeTrue if the attributes values need to be escaped
indentLine indent
origIndentOriginal indent
completeOnlyTrue to build only if complete

Returns: Written bytes, negative on error

XmlSaxParser::Error  loadFile (const char* file, int* error = 0)

loadFile

Load a file an parse it Reset the document

Parameters:
fileThe file to load
errorPointer to data to be filled with file error if IOError is returned

Returns: Parser error (NoError on success)

int  saveFile (const char* file = 0, bool escape = true, const String& indent = String::empty(), bool completeOnly = true)

saveFile

[const]

Save this xml document in the specified file. Create a new fle if not found. Truncate an existing one

Parameters:
fileThe file to save or will be used the file used on load
escapeTrue if the attributes values need to be escaped
indentSpaces for output
completeOnlyTrue to build only if complete

Returns: 0 on success, error code on failure

void  toString (String& dump, bool escape = true, const String& indent = String::empty(), const String& origIndent = String::empty())

toString

[const]

Build a String from this XmlDocument

Parameters:
dumpThe string where to append representation
escapeTrue if the attributes values need to be escaped
indentSpaces for output
origIndentOriginal indent


Generated by: paulc on bussard on Sun Oct 20 21:06:06 2013, using kdoc 2.0a54.