#include <LDK/XML.h>
Inheritance diagram for LDK::XmlBase:
Public Types | |
enum | { LDKXML_NO_ERROR = 0, LDKXML_ERROR, LDKXML_ERROR_OPENING_FILE, LDKXML_ERROR_OUT_OF_MEMORY, LDKXML_ERROR_PARSING_ELEMENT, LDKXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, LDKXML_ERROR_READING_ELEMENT_VALUE, LDKXML_ERROR_READING_ATTRIBUTES, LDKXML_ERROR_PARSING_EMPTY, LDKXML_ERROR_READING_END_TAG, LDKXML_ERROR_PARSING_UNKNOWN, LDKXML_ERROR_PARSING_COMMENT, LDKXML_ERROR_PARSING_DECLARATION, LDKXML_ERROR_DOCUMENT_EMPTY, LDKXML_ERROR_EMBEDDED_NULL, LDKXML_ERROR_STRING_COUNT } |
Public Member Functions | |
XmlBase () | |
virtual | ~XmlBase () |
virtual void | Print (SmartFile f, int depth) const=0 |
int | Row () const |
int | Column () const |
See Row(). | |
void | SetUserData (void *user) |
void * | GetUserData () |
virtual const char * | Parse (const char *p, XmlParsingData *data, XmlEncoding encoding)=0 |
Static Public Member Functions | |
static void | SetCondenseWhiteSpace (bool condense) |
static bool | IsWhiteSpaceCondensed () |
Return the current white space setting. | |
Static Public Attributes | |
static const int | utf8ByteTable [256] |
Protected Member Functions | |
virtual void | StreamOut (LDKXML_OSTREAM *) const=0 |
Static Protected Member Functions | |
static const char * | SkipWhiteSpace (const char *, XmlEncoding encoding) |
static bool | IsWhiteSpace (char c) |
static const char * | ReadName (const char *p, LDKXML_STRING *name, XmlEncoding encoding) |
static const char * | ReadText (const char *in, LDKXML_STRING *text, bool ignoreWhiteSpace, const char *endTag, bool ignoreCase, XmlEncoding encoding) |
static const char * | GetEntity (const char *in, char *value, int *length, XmlEncoding encoding) |
static const char * | GetChar (const char *p, char *_value, int *length, XmlEncoding encoding) |
static void | PutString (const LDKXML_STRING &str, LDKXML_OSTREAM *out) |
static void | PutString (const LDKXML_STRING &str, LDKXML_STRING *out) |
static bool | StringEqual (const char *p, const char *endTag, bool ignoreCase, XmlEncoding encoding) |
static int | IsAlpha (unsigned char anyByte, XmlEncoding encoding) |
static int | IsAlphaNum (unsigned char anyByte, XmlEncoding encoding) |
static int | ToLower (int v, XmlEncoding encoding) |
static void | ConvertUTF32ToUTF8 (unsigned long input, char *output, int *length) |
Protected Attributes | |
XmlCursor | location |
void * | userData |
Field containing a generic user pointer. | |
Static Protected Attributes | |
static const char * | errorString [LDKXML_ERROR_STRING_COUNT] |
Friends | |
class LDK_API | XmlNode |
class LDK_API | XmlElement |
class LDK_API | XmlDocument |
Data Structures | |
struct | Entity |
In XML, the document and elements can contain other elements and other types of nodes.
A Document can contain: Element (container or leaf) Comment (leaf) Unknown (leaf) Declaration( leaf ) An Element can contain: Element (container or leaf) Text (leaf) Attributes (not on tree) Comment (leaf) Unknown (leaf) A Decleration contains: Attributes (not on tree)
Definition at line 168 of file XML.h.
virtual void LDK::XmlBase::Print | ( | SmartFile | f, | |
int | depth | |||
) | const [pure virtual] |
All TinyXml classes can print themselves to a filestream. This is a formatted print, and will insert tabs and newlines.
(For an unformatted stream, use the << operator.)
Implemented in LDK::XmlAttribute, LDK::XmlElement, LDK::XmlComment, LDK::XmlText, LDK::XmlDeclaration, LDK::XmlUnknown, and LDK::XmlDocument.
static void LDK::XmlBase::SetCondenseWhiteSpace | ( | bool | condense | ) | [inline, static] |
The world does not agree on whether white space should be kept or not. In order to make everyone happy, these global, static functions are provided to set whether or not TinyXml will condense all white space into a single space or not. The default is to condense. Note changing this values is not thread safe.
int LDK::XmlBase::Row | ( | ) | const [inline] |
Return the position, in the original source file, of this node or attribute. The row and column are 1-based. (That is the first row and first column is 1,1). If the returns values are 0 or less, then the parser does not have a row and column value.
Generally, the row and column value will be set when the XmlDocument::Load(), XmlDocument::LoadFile(), or any XmlNode::Parse() is called. It will NOT be set when the DOM was created from operator>>.
The values reflect the initial load. Once the DOM is modified programmatically (by adding or changing nodes and attributes) the new values will NOT update to reflect changes in the document.
There is a minor performance cost to computing the row and column. Computation can be disabled if XmlDocument::SetTabSize() is called with 0 as the value.