XMLDOC Class Reference

#include <mi32/xml.h>

Inheritance diagram for XMLDOC:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 XMLDOC (const XMLDOC &)
 XMLDOC (const UINT8 *xmlbuffer)
 XMLDOC (const MIUNICODE *xmlbuffer)
 XMLDOC ()
virtual ~XMLDOC ()
void AddEntity (const char *name, MIUNICODE content)
void AddEntity (const char *name, const MIUNICODE *content)
void Clear ()
xmlDocPtr * GetDocPtr () const
const MISTRINGGetErrorMessage () const
XMLNODEGetRootNode () const
XMLDOCoperator= (const XMLDOC &)
ERRVALUE Parse (const UINT8 *xmlbuffer)
ERRVALUE ParseHTML (const UINT8 *xmlbuffer)
ERRVALUE Read (const MIUNICODE *filename)
ERRVALUE Read (const FILEPATH &filepath)
ERRVALUE ReadHTML (const MIUNICODE *filename)
ERRVALUE ReadHTML (const FILEPATH &filepath)
void SetCompression (int compression)
void Unparse (STRUTF8 &string, bool bIndentTreeOutput=true) const
void Unparse (MISTRING &string, bool bIndentTreeOutput=true) const
void UnparseHTML (STRUTF8 &string, bool bIndentTreeOutput=true) const
void UnparseHTML (MISTRING &string, bool bIndentTreeOutput=true) const
ERRVALUE Write (FILE_RAW &file) const
ERRVALUE Write (const MIUNICODE *filename) const
ERRVALUE Write (const FILEPATH &filepath) const
ERRVALUE WriteHTML (FILE_RAW &file) const
ERRVALUE WriteHTML (const MIUNICODE *filename) const
ERRVALUE WriteHTML (const FILEPATH &filepath) const

Protected Member Functions

virtual void OnDocReplaced ()

Constructor & Destructor Documentation

XMLDOC::XMLDOC (  ) 

Constructor. Constructs an empty document.

XMLDOC::XMLDOC ( const MIUNICODE xmlbuffer  ) 

Constructor.

Constructs an XML document given one read into memory. Note: MIUNICODE string gets converted to UTF8 before parsing. If you are reading it in UTF8 to begin with, converting it to Unicode and constructing it that way is a waste of time. Use the constructor that takes UTF8 instead.

XMLDOC::XMLDOC ( const UINT8 xmlbuffer  ) 

Constructor.

Constructs an XML document given one read into memory (Buffer must be in UTF8 encoding)

XMLDOC::XMLDOC ( const XMLDOC  ) 

Copy constructor.

Note, copy constructor is expensive. It has to copy the whole document tree in memory.

virtual XMLDOC::~XMLDOC (  )  [virtual]

Destructor.


Member Function Documentation

void XMLDOC::AddEntity ( const char *  name,
MIUNICODE  content 
)

Add an entity to the XML document defintion.

Allows you to register non-standard entities such as &deg; This method is the simple case. A single character entity.

Parameters:
name Without the "&" or ";"
void XMLDOC::AddEntity ( const char *  name,
const MIUNICODE content 
)

Add an entity to the XML document defintion.

Allows you to register non-standard entities such as &deg; This method is the generic case, multiple-character entity.

Parameters:
name Without the "&" or ";"
void XMLDOC::Clear (  ) 

Reset the document to a single, empty <root> node.

xmlDocPtr* XMLDOC::GetDocPtr (  )  const
const MISTRING& XMLDOC::GetErrorMessage (  )  const

Returns a string holding the error message from the last call to Parse or Read.

XMLNODE* XMLDOC::GetRootNode (  )  const

Get the root node of the document.

virtual void XMLDOC::OnDocReplaced (  )  [protected, virtual]

Will be called by Read and Parse methods to inform derived class that the whole document has been changed out from under it.

XMLDOC& XMLDOC::operator= ( const XMLDOC  ) 

Assignment operator Note, asignment is expensive.

It has to copy the whole document tree in memory.

ERRVALUE XMLDOC::Parse ( const UINT8 xmlbuffer  ) 

Parse an XML document already read into memory.

(Buffer must be in UTF8 encoding)

Reimplemented in HTML::HTMLDOC.

ERRVALUE XMLDOC::ParseHTML ( const UINT8 xmlbuffer  ) 

Parse an HTML document already read into memory.

Similar to Parse() but HTML has more relaxed rules (Buffer must be in UTF8 encoding)

ERRVALUE XMLDOC::Read ( const MIUNICODE filename  ) 

Read an XML file The file must be in UTF8 encoding.

ERRVALUE XMLDOC::Read ( const FILEPATH filepath  ) 

Read an XML file The file must be in UTF8 encoding.

Reimplemented in HTML::HTMLDOC.

ERRVALUE XMLDOC::ReadHTML ( const MIUNICODE filename  ) 

Read an HTML file Similar to Read() but HTML has more relaxed rules The file must be in UTF8 encoding.

ERRVALUE XMLDOC::ReadHTML ( const FILEPATH filepath  ) 

Read an HTML file.

Similar to Read() but HTML has more relaxed rules The file must be in UTF8 encoding

void XMLDOC::SetCompression ( int  compression  ) 
void XMLDOC::Unparse ( STRUTF8 string,
bool  bIndentTreeOutput = true 
) const

Convert the in-memory structure to a STRUTF8.

void XMLDOC::Unparse ( MISTRING string,
bool  bIndentTreeOutput = true 
) const

Convert the in-memory structure to an MISTRING.

void XMLDOC::UnparseHTML ( STRUTF8 string,
bool  bIndentTreeOutput = true 
) const

Convert the in-memory structure to a STRUTF8 using HTML formatting rules.

void XMLDOC::UnparseHTML ( MISTRING string,
bool  bIndentTreeOutput = true 
) const

Convert the in-memory structure to an MISTRING using HTML formatting rules.

ERRVALUE XMLDOC::Write ( FILE_RAW file  )  const

Write out to an XML file to an open FILE_RAW Does not try to seek in the file, resize it or close.

It just starts writing at the current file position

ERRVALUE XMLDOC::Write ( const MIUNICODE filename  )  const

Write out to an XML file The resulting file will be in UTF8 encoding.

ERRVALUE XMLDOC::Write ( const FILEPATH filepath  )  const

Write out to an XML file The resulting file will be in UTF8 encoding.

ERRVALUE XMLDOC::WriteHTML ( FILE_RAW file  )  const

Write out to an XML file to an open FILE_RAW Same as Write, but HTML has slightly different formatting rules Does not try to seek in the file, resize it or close.

It just starts writing at the current file position

ERRVALUE XMLDOC::WriteHTML ( const MIUNICODE filename  )  const

Write out to an XML file Same as Write, but HTML has slightly different formatting rules.

ERRVALUE XMLDOC::WriteHTML ( const FILEPATH filepath  )  const

Write out to an XML file as an HTML file Same as Write, but HTML has slightly different formatting rules.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:34:02 2012 for TNTsdk 2012 by  doxygen 1.6.1