|
Yate
|
Serial Access XML Parser. More...
#include <yatexml.h>
Public Member Functions | |
| virtual | ~XmlSaxParser () |
| unsigned int | offset () const |
| unsigned int | row () const |
| unsigned int | column () const |
| const String & | buffer () const |
| bool | parse (const char *data) |
| bool | completeText () |
| Error | error () |
| bool | setError (Error error, XmlChild *child=0) |
| const char * | getError (const char *defVal="Xml error") |
| Type | unparsed () |
| void | setUnparsed (Type id) |
| virtual void | reset () |
| const String & | getBuffer () const |
Public Member Functions inherited from DebugEnabler | |
| DebugEnabler (int level=TelEngine::debugLevel(), bool enabled=true) | |
| int | debugLevel () const |
| int | debugLevel (int level) |
| bool | debugEnabled () const |
| void | debugEnabled (bool enable) |
| const char * | debugName () const |
| bool | debugAt (int level) const |
| bool | debugChained () const |
| void | debugChain (const DebugEnabler *chain=0) |
| void | debugCopy (const DebugEnabler *original=0) |
Static Public Member Functions | |
| static const char * | getError (int code, const char *defVal="Xml error") |
| static bool | blank (char c) |
| static bool | checkFirstNameCharacter (unsigned char ch) |
| static bool | checkDataChar (unsigned char c) |
| static bool | checkNameCharacter (unsigned char ch) |
| static bool | validTag (const String &buf) |
| static void | escape (String &buf, const String &text) |
Static Public Attributes | |
| static const TokenDict | s_errorString [] |
| static const XmlEscape | s_escape [] |
Protected Attributes | |
| unsigned int | m_offset |
| unsigned int | m_row |
| unsigned int | m_column |
| Error | m_error |
| String | m_buf |
| NamedList | m_parsed |
| Type | m_unparsed |
Serial Access XML Parser.
A Serial Access Parser (SAX) for arbitrary XML data
|
virtual |
Destructor
|
protected |
Constructor
| name | Debug name |
|
protected |
Parse an unfinished xml object. Extracts the parsed string from buffer if returns true
Check if a character is an angle bracket
| c | The character to verify |
Check if the given character is blank
| c | The character to verify |
Check if the given character is in the range allowed for an xml char
| c | The character to check |
Verify if the given character is in the range allowed to be first character from a xml tag
| ch | The character to check |
Verify if the given character is in the range allowed for a xml name
| ch | The character to check |
Get the column where the parser has found an error
References XmlSaxParser::m_column.
Callback method. Is called to check if we have an incomplete element. Default implementation returns always true
Reimplemented in XmlDomParser.
| bool completeText | ( | ) |
Process incomplete text if the parser is completed. This method should be called to complete text after all data was pushed into the parser
Callback method. Is called when a end tag was successfully parsed. Default implementation does nothing
| name | The end tag name |
Reimplemented in XmlDomParser.
|
inline |
XmlEscape the given text
| buf | Destination buffer |
| text | The text to escape |
Extract the name of an element or instruction
|
protected |
Extract an attribute
References XmlSaxParser::m_buf.
Retrieve the error string associated with current error status
| defVal | Value to return if not found |
References XmlSaxParser::getError(), and XmlSaxParser::m_error.
Referenced by XmlSaxParser::getError().
Retrieve the error string associated with a given error code
| code | Code of the error to look up |
| defVal | Value to return if not found |
References XmlSaxParser::s_errorString.
Callback method. Is called when a CData section was successfully parsed. Default implementation does nothing
| data | The CData content |
Reimplemented in XmlDomParser.
Callback method. Is called when a comment was successfully parsed. Default implementation does nothing
| text | The comment content |
Reimplemented in XmlDomParser.
Callback method. Is called when a declaration was successfully parsed. Default implementation does nothing
| decl | The declaration content |
Reimplemented in XmlDomParser.
Callback method. Is called when a doctype was successfully parsed. Default implementation does nothing
| doc | The doctype content |
Reimplemented in XmlDomParser.
Callback method. Is called when an element was successfully parsed. Default implementation does nothing
| element | The element content |
| empty | True if the element does not have attributes |
Reimplemented in XmlDomParser.
|
inlineprotectedvirtual |
Callback method. Is called when an instruction was successfully parsed. Default implementation does nothing
| instr | The instruction content |
Reimplemented in XmlDomParser.
Callback method. Is called when a text was successfully parsed. Default implementation does nothing
| text | The text content |
Reimplemented in XmlDomParser.
Get the number of bytes successfully parsed
References XmlSaxParser::m_offset.
Parse a given string
| data | The data to parse |
|
protected |
Parse a CData section form the main buffer. Extracts the parsed string from buffer if returns true
|
protected |
Parse a comment form the main buffer. Extracts the parsed string from buffer if returns true
|
protected |
Parse a declaration form the main buffer. Extracts the parsed string from buffer if returns true
|
protected |
Parse a doctype form the main buffer. Extracts the parsed string from buffer if returns true. Warning: This is a stub implementation
|
protected |
Parse an element form the main buffer. Extracts the parsed string from buffer if returns true
|
protected |
Parse an endtag form the main buffer. Extracts the parsed string from buffer if returns true
|
protected |
Parse an instruction form the main buffer. Extracts the parsed string from buffer if returns true
|
protected |
Helper method to classify the Xml objects starting with "<!" sequence. Extracts the parsed string from buffer if returns true
Calls gotElement() and eset parsed on success
| list | The list element and its attributes |
| empty | True if the element does not have attributes |
Unescape text, call gotText() and reset parsed on success
| text | The text to process |
Reset error flag
Reimplemented in XmlDomParser.
|
inlineprotected |
Reset the error
References XmlSaxParser::m_error.
|
inlineprotected |
Reset parsed value and parameters
References String::clear(), NamedList::clearParams(), and XmlSaxParser::m_parsed.
Get the row where the parser has found an error
References XmlSaxParser::m_row.
Set the error code and destroys a child if error code is not NoError
| error | The error found |
| child | Child to destroy |
|
inline |
Set the last xml type that we were parsing, but we have not finished
| id | The xml type that we haven't finish to parse |
References XmlSaxParser::m_unparsed.
|
protected |
Remove blank characters from the begining of the buffer
Unescape the given text. Handled: < > ' " & &#DecimalNumber; &#xHexNumber;
| text | The requested text to unescape |
|
inline |
References XmlSaxParser::m_unparsed.
Check if a given string is a valid xml tag name
| buf | The string to check |
|
protected |
The main buffer
Referenced by XmlSaxParser::buffer(), and XmlSaxParser::getBuffer().
The column where the parser was stop
Referenced by XmlSaxParser::column().
|
protected |
The error code found while parsing data
Referenced by XmlSaxParser::error(), XmlSaxParser::getError(), and XmlSaxParser::resetError().
The offset where the parser was stop
Referenced by XmlSaxParser::offset().
|
protected |
The parser data holder. Keeps the parsed data when an incomplete xml object is found
Referenced by XmlSaxParser::resetParsed().
The row where the parser was stop
Referenced by XmlSaxParser::row().
|
protected |
The last parsed xml object code
Referenced by XmlSaxParser::setUnparsed(), and XmlSaxParser::unparsed().
Errors dictionary
Referenced by XmlSaxParser::getError().