nlib
|
Abstract class that reads from an XML stream. More...
#include "nn/nlib/exi/XmlStreamReader.h"
Public Types | |
enum | XmlStreamConstants { NONE = -1, START_ELEMENT = 1, END_ELEMENT = 2, PROCESSING_INSTRUCTION = 3, CHARACTERS = 4, COMMENT = 5, START_DOCUMENT = 7, END_DOCUMENT = 8, CDATA = 12 } |
Values of XML stream events that occurred while reading an XML stream. More... | |
Public Member Functions | |
const ExiChar * | GetElementText () noexcept |
Reads a series of text events and returns a single text element. More... | |
const ExiChar * | GetLocalName () noexcept |
Gets the local name. More... | |
const ExiChar * | GetNamespaceUri () noexcept |
Gets the URI of the XML namespace. More... | |
const ExiChar * | GetPrefix () noexcept |
Gets the namespace prefix of the XML. More... | |
const ExiChar * | GetText () noexcept |
Gets text data. More... | |
XmlStreamConstants | GetEventType () const noexcept |
Returns the value for the most recent XML stream event. | |
XML Attribute Operations | |
size_t | GetAttributeCount () noexcept |
Gets the number of attributes. More... | |
const ExiChar * | GetAttributeLocalName (size_t index) noexcept |
Gets the local name of an attribute. More... | |
const ExiChar * | GetAttributeNamespaceUri (size_t index) noexcept |
Gets the namespace URI of an attribute. More... | |
const ExiChar * | GetAttributePrefix (size_t index) noexcept |
Gets the prefix of an attribute. More... | |
const ExiChar * | GetAttributeValue (size_t index) noexcept |
Gets the value of an attribute. More... | |
const ExiChar * | GetAttributeValue (const ExiChar *namespace_uri, const ExiChar *local_name) noexcept |
Gets the value of the attribute based on a particular namespace URI and local name. More... | |
XML Namespace Operations | |
size_t | GetNamespaceCount () noexcept |
Gets the number of newly defined namespaces. More... | |
const ExiChar * | GetNamespacePrefix (size_t index) noexcept |
Gets the prefix of a namespace declaration. More... | |
const ExiChar * | GetNamespaceUri (size_t index) noexcept |
Gets the namespace URI of a namespace declaration. More... | |
Error Checking | |
int | GetLineNo () const noexcept |
Gets the line number indicated by the XmlStreamReader . More... | |
int | GetColumnNo () const noexcept |
Gets the column number indicated by the XmlStreamReader . More... | |
bool | IsError () const noexcept |
Returns true if an error has occurred. | |
bool | IsOk () const noexcept |
Returns true if an error has not occurred. | |
ExiErrorStatus::ErrorValue | GetError () const noexcept |
Gets the error value. | |
ExiErrorStatus * | GetErrorStatus () const noexcept |
Gets an error status object. | |
operator bool () const | |
Returns true if an error has not occurred. | |
Getting XML Stream Events | |
XmlStreamConstants | Next () noexcept |
Reads the next XML stream event from the stream. More... | |
bool | HasNext () const noexcept |
Returns whether the next XML stream event can be obtained. More... | |
XML Stream Event Determination | |
bool | HasName () const noexcept |
Returns whether data like a local name can be obtained. More... | |
bool | HasText () const noexcept |
Returns whether text is ready to be obtained using GetText() . More... | |
bool | IsCharacters () const noexcept |
Gets whether the data that was read is a text node. More... | |
bool | IsEndElement () const noexcept |
Gets whether the data that was read is a closing tag. More... | |
bool | IsStartElement () const noexcept |
Gets whether the data that was read is an opening tag. More... | |
XmlStreamReader Object Initialization and Finalization | |
Instantiates an object using a static member function.
| |
static XmlStreamReader * | Create (InputStream *stream, const XmlStreamReaderSettings &settings, const ExiAllocatorEx &al) noexcept |
Creates an XmlStreamReader instance by specifying an objectwise allocator. More... | |
static XmlStreamReader * | Create (InputStream *stream, const XmlStreamReaderSettings &settings) noexcept |
Creates an instance of XmlStreamReader . More... | |
static XmlStreamReader * | Create (InputStream *stream) noexcept |
Creates an XmlStreamReader instance using default settings for XmlStreamReaderSettings . More... | |
static XmlStreamReader * | Create (InputStream *stream, const ExiAllocatorEx &al) noexcept |
Creates an XmlStreamReader instance by specifying an objectwise allocator. More... | |
virtual | ~XmlStreamReader () noexcept |
Destructor. | |
void | Close () noexcept |
Closes an XmlStreamReader . The original stream is not actually closed; it merely stops being referenced. | |
Abstract class that reads from an XML stream.
XMLStreamReader
class in Java StAX
. XmlStreamReader
object is deleted. You do not necessarily need to perform a string copy if you are creating something like an associative array that uses the local names and other attributes of elements as keys. Definition at line 43 of file XmlStreamReader.h.
Values of XML stream events that occurred while reading an XML stream.
Definition at line 45 of file XmlStreamReader.h.
|
staticnoexcept |
Creates an XmlStreamReader
instance by specifying an objectwise allocator.
[in] | stream | Original output stream. |
[in] | settings | Configuration options. |
[in] | al | Allocator. |
XmlStreamReader
instance that was created.
|
inlinestaticnoexcept |
Creates an instance of XmlStreamReader
.
[in] | stream | Original input stream. |
[in] | settings | Configuration options. |
XmlStreamReader
instance that was created.ExiAllocator
. If successful, it returns a non-NULL
pointer. Generally, the pointer that is returned is stored and used via UniquePtr
. XmlStreamReaderSettings
. Definition at line 65 of file XmlStreamReader.h.
|
inlinestaticnoexcept |
Creates an XmlStreamReader
instance using default settings for XmlStreamReaderSettings
.
[in] | stream | Original input stream. |
XmlStreamReader
instance that was created.Definition at line 70 of file XmlStreamReader.h.
|
inlinestaticnoexcept |
Creates an XmlStreamReader
instance by specifying an objectwise allocator.
[in] | stream | Original output stream. |
[in] | al | Allocator. |
XmlStreamReader
instance that was created. Definition at line 74 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the number of attributes.
0
. Definition at line 87 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the local name of an attribute.
[in] | index | Specifies the index. |
NULL
if no attribute corresponds to the specified index. XmlStreamReader
object exists. Definition at line 91 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the namespace URI of an attribute.
[in] | index | Specifies the index. |
NULL
if no attribute corresponds to the specified index. XmlStreamReader
object exists. Definition at line 95 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the prefix of an attribute.
[in] | index | Specifies the index. |
NULL
if no attribute corresponds to the specified index. XmlStreamReader
object exists. Definition at line 99 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the value of an attribute.
[in] | index | Specifies the index. |
NULL
if no attribute corresponds to the specified index. XmlStreamReader
object exists. Definition at line 107 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the value of the attribute based on a particular namespace URI and local name.
[in] | namespace_uri | Namespace URI. (NULL is not allowed.) |
[in] | local_name | Local name. (NULL is not allowed.) |
NULL
. Definition at line 111 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the column number indicated by the XmlStreamReader
.
1
. Returns 0
when parsing binary XML. Definition at line 149 of file XmlStreamReader.h.
|
inlinenoexcept |
Reads a series of text events and returns a single text element.
XmlStreamWriter::WriteCharacters
was called repeatedly during XML creation. In such cases, if you want to handle this text as a single string, get the text data by calling this function. NULL
. Definition at line 128 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the line number indicated by the XmlStreamReader
.
1
. Returns 0
when parsing binary XML. Definition at line 148 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the local name.
NULL
. XmlStreamReader
object exists. Definition at line 132 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the number of newly defined namespaces.
0
. Definition at line 116 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the prefix of a namespace declaration.
[in] | index | Specifies the index. |
NULL
if no namespace declaration corresponds to the specified index. XmlStreamReader
object exists. Definition at line 120 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the namespace URI of a namespace declaration.
[in] | index | Specifies the index. |
NULL
if no namespace declaration corresponds to the specified index. XmlStreamReader
object exists. Definition at line 124 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the URI of the XML namespace.
NULL
. XmlStreamReader
object exists. Definition at line 136 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets the namespace prefix of the XML.
NULL
. XmlStreamReader
object exists. Definition at line 140 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets text data.
XmlStreamReader::CHARACTERS:
Returns the text in the text node. String data is valid as long as the XmlStreamReader
object exists. XmlStreamReader::COMMENT:
Returns the comment. String data is valid until the next event is read. XmlStreamReader::PROCESSING_INSTRUCTION:
Returns the data in the PI. String data is valid until the next event is read. NULL
. Definition at line 144 of file XmlStreamReader.h.
|
inlinenoexcept |
Returns whether data like a local name can be obtained.
true
if an opening tag, closing tag, or PI has been obtained. Definition at line 157 of file XmlStreamReader.h.
|
inlinenoexcept |
Returns whether the next XML stream event can be obtained.
true
. Definition at line 161 of file XmlStreamReader.h.
|
inlinenoexcept |
Returns whether text is ready to be obtained using GetText()
.
true
if a text, a CDATA section, comment, or PI has been obtained. Definition at line 162 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets whether the data that was read is a text node.
true
if the data was text or a CDATA section, or false
otherwise. Definition at line 166 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets whether the data that was read is a closing tag.
true
if the data was a closing tag, or false
otherwise. Definition at line 167 of file XmlStreamReader.h.
|
inlinenoexcept |
Gets whether the data that was read is an opening tag.
true
if the data was an opening tag, or false
otherwise. Definition at line 168 of file XmlStreamReader.h.
|
inlinenoexcept |
Reads the next XML stream event from the stream.
Definition at line 150 of file XmlStreamReader.h.
© 2013, 2014, 2015 Nintendo Co., Ltd. All rights reserved.