libxml++
2.35.2
|
A TextReader-style XML parser A reader that provides fast, non-cached, forward-only access to XML data, in the style of .Net's XmlTextReader class. More...
#include <libxml++/parsers/textreader.h>
Public Types | |
enum | xmlNodeType { Attribute = 2, CDATA = 4, Comment = 8, Document = 9, DocumentFragment = 11, DocumentType = 10, Element = 1, EndElement = 15, EndEntity = 16, Entity = 6, EntityReference = 5, None = 0, Notation = 12, ProcessingInstruction = 7, SignificantWhitespace = 14, Text = 3, Whitespace = 13, XmlDeclaration = 17 } |
enum | xmlReadState { Closed = 4, EndOfFile = 3, Error = 2, Initial = 0, Interactive = 1, Reading = 5 } |
enum | ParserProperties { LoadDtd = 1, DefaultAttrs = 2, Validate = 3, SubstEntities = 4 } |
typedef unsigned int | size_type |
Public Member Functions | |
TextReader (struct _xmlTextReader* cobj) | |
Wraps a TextReader object from an underlying libxml object. | |
TextReader (const Glib::ustring& URI) | |
Creates a new TextReader object to parse a file or URI. | |
TextReader (const unsigned char* data, size_type size, const Glib::ustring& uri=Glib::ustring()) | |
Creates a new TextReader object which parses in memory data. | |
~TextReader () | |
bool | read () |
Moves the position of the current instance to the next node in the stream, exposing its properties. | |
Glib::ustring | read_inner_xml () |
Reads the contents of the current node, including child nodes and markup. | |
Glib::ustring | read_outer_xml () |
Reads the current node and its contents, including child nodes and markup. | |
Glib::ustring | read_string () |
Reads the contents of an element or a text node as a string. | |
bool | read_attribute_value () |
Parses an attribute value into one or more Text and EntityReference nodes. | |
int | get_attribute_count () const |
Gets the number of attributes on the current node. | |
Glib::ustring | get_base_uri () const |
Gets the base Uniform Resource Identifier (URI) of the current node. | |
int | get_depth () const |
Gets the depth of the current node in the XML document. | |
bool | has_attributes () const |
Gets a value indicating whether the current node has any attributes. | |
bool | has_value () const |
Whether the node can have a text value. | |
bool | is_default () const |
Whether an Attribute node was generated from the default value defined in the DTD or schema. | |
bool | is_empty_element () const |
Check if the current node is empty. | |
Glib::ustring | get_local_name () const |
Glib::ustring | get_name () const |
Glib::ustring | get_namespace_uri () const |
xmlNodeType | get_node_type () const |
Glib::ustring | get_prefix () const |
char | get_quote_char () const |
Glib::ustring | get_value () const |
Glib::ustring | get_xml_lang () const |
xmlReadState | get_read_state () const |
void | close () |
Glib::ustring | get_attribute (int number) const |
Glib::ustring | get_attribute (const Glib::ustring& name) const |
Glib::ustring | get_attribute (const Glib::ustring& local_name, const Glib::ustring& ns_uri) const |
Glib::ustring | lookup_namespace (const Glib::ustring& prefix) const |
bool | move_to_attribute (int number) |
bool | move_to_attribute (const Glib::ustring& name) |
bool | move_to_attribute (const Glib::ustring& local_name, const Glib::ustring& ns_uri) |
bool | move_to_first_attribute () |
bool | move_to_next_attribute () |
bool | move_to_element () |
bool | get_normalization () const |
void | set_normalization (bool value) |
bool | get_parser_property (ParserProperties property) const |
void | set_parser_property (ParserProperties property, bool value) |
Node* | get_current_node () |
const Node* | get_current_node () const |
Node* | expand () |
bool | next () |
bool | is_valid () const |
A TextReader-style XML parser A reader that provides fast, non-cached, forward-only access to XML data, in the style of .Net's XmlTextReader class.
typedef unsigned int xmlpp::TextReader::size_type |
xmlpp::TextReader::TextReader | ( | struct _xmlTextReader * | cobj | ) |
Wraps a TextReader object from an underlying libxml object.
The TextReader takes ownership of cobj.
cobj | The underlying libxml xmlTextReader object. |
xmlpp::TextReader::TextReader | ( | const Glib::ustring & | URI | ) |
Creates a new TextReader object to parse a file or URI.
URI | The URI to read. |
xmlpp::TextReader::TextReader | ( | const unsigned char * | data, |
size_type | size, | ||
const Glib::ustring & | uri = Glib::ustring() |
||
) |
Creates a new TextReader object which parses in memory data.
data | The data to parse. |
size | The number of bytes in data. |
uri | The base URI of the file. |
void xmlpp::TextReader::close | ( | ) |
Glib::ustring xmlpp::TextReader::get_attribute | ( | int | number | ) | const |
Glib::ustring xmlpp::TextReader::get_attribute | ( | const Glib::ustring & | name | ) | const |
Glib::ustring xmlpp::TextReader::get_attribute | ( | const Glib::ustring & | local_name, |
const Glib::ustring & | ns_uri | ||
) | const |
int xmlpp::TextReader::get_attribute_count | ( | ) | const |
Gets the number of attributes on the current node.
Glib::ustring xmlpp::TextReader::get_base_uri | ( | ) | const |
Gets the base Uniform Resource Identifier (URI) of the current node.
const Node* xmlpp::TextReader::get_current_node | ( | ) | const |
int xmlpp::TextReader::get_depth | ( | ) | const |
Gets the depth of the current node in the XML document.
Glib::ustring xmlpp::TextReader::get_name | ( | ) | const |
xmlNodeType xmlpp::TextReader::get_node_type | ( | ) | const |
bool xmlpp::TextReader::get_normalization | ( | ) | const |
bool xmlpp::TextReader::get_parser_property | ( | ParserProperties | property | ) | const |
Glib::ustring xmlpp::TextReader::get_prefix | ( | ) | const |
char xmlpp::TextReader::get_quote_char | ( | ) | const |
Glib::ustring xmlpp::TextReader::get_value | ( | ) | const |
Glib::ustring xmlpp::TextReader::get_xml_lang | ( | ) | const |
bool xmlpp::TextReader::has_attributes | ( | ) | const |
Gets a value indicating whether the current node has any attributes.
bool xmlpp::TextReader::has_value | ( | ) | const |
Whether the node can have a text value.
bool xmlpp::TextReader::is_default | ( | ) | const |
Whether an Attribute node was generated from the default value defined in the DTD or schema.
bool xmlpp::TextReader::is_empty_element | ( | ) | const |
Check if the current node is empty.
bool xmlpp::TextReader::is_valid | ( | ) | const |
Glib::ustring xmlpp::TextReader::lookup_namespace | ( | const Glib::ustring & | prefix | ) | const |
bool xmlpp::TextReader::move_to_attribute | ( | int | number | ) |
bool xmlpp::TextReader::move_to_attribute | ( | const Glib::ustring & | name | ) |
bool xmlpp::TextReader::move_to_attribute | ( | const Glib::ustring & | local_name, |
const Glib::ustring & | ns_uri | ||
) |
bool xmlpp::TextReader::move_to_element | ( | ) |
bool xmlpp::TextReader::next | ( | ) |
bool xmlpp::TextReader::read | ( | ) |
Moves the position of the current instance to the next node in the stream, exposing its properties.
Parses an attribute value into one or more Text and EntityReference nodes.
Reads the contents of the current node, including child nodes and markup.
Reads the current node and its contents, including child nodes and markup.
Reads the contents of an element or a text node as a string.
void xmlpp::TextReader::set_normalization | ( | bool | value | ) |
void xmlpp::TextReader::set_parser_property | ( | ParserProperties | property, |
bool | value | ||
) |