[#BloombergLP-balxml-Reader]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::Reader
:relfileprefix: ../../
:mrdocs:

This abstract class defines an interface for fast, forward&hyphen;only access to XML data&period;

== Synopsis

Declared in `&lt;balxml&lowbar;reader&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Reader;
----

== Description

An object belonging to a derived&hyphen;class implementation of this protocol is required to be re&hyphen;usable, such that a new XML document can be parsed using the same reader object by calling `close` followed by another `open`&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balxml/Reader/StreamBufPtr.adoc[`StreamBufPtr`] 
| Managed pointer to a `bsl&colon;&colon;streambuf` used for external entity input&period;
| xref:BloombergLP/balxml/Reader/XmlResolverFunctor.adoc[`XmlResolverFunctor`] 
| Type for a user&hyphen;supplied functor that opens an external XML resource&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balxml/Reader/NodeType-02.adoc[`NodeType`] 
| Node types returned by `nodeType`, representing XML syntactic constructs within a document&period; Not every `Reader` implementation distinguishes all node types&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balxml/Reader/2destructor.adoc[`&#126;Reader`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy this object&period; The implementation for this pure abstract base class does nothing&period;
| xref:BloombergLP/balxml/Reader/advanceToNextNode.adoc[`advanceToNextNode`]  [.small]#[virtual]#
| Move to the next node in the data stream created by `open`&period;
| xref:BloombergLP/balxml/Reader/close.adoc[`close`]  [.small]#[virtual]#
| Close the reader&period;
| xref:BloombergLP/balxml/Reader/documentEncoding.adoc[`documentEncoding`]  [.small]#[virtual]#
| Return the document encoding or NULL on error&period;
| xref:BloombergLP/balxml/Reader/dumpNode.adoc[`dumpNode`] 
| Print the information about the current node to the specified output `os` stream&period;
| xref:BloombergLP/balxml/Reader/errorInfo.adoc[`errorInfo`]  [.small]#[virtual]#
| Return a reference to the non&hyphen;modifiable error information for this reader&period; The returned value becomes invalid when `close` is called or the reader is destroyed&period;
| xref:BloombergLP/balxml/Reader/getColumnNumber.adoc[`getColumnNumber`]  [.small]#[virtual]#
| Return the current column number within the input stream&period;
| xref:BloombergLP/balxml/Reader/getLineNumber.adoc[`getLineNumber`]  [.small]#[virtual]#
| Return the current line number within the input stream&period;
| xref:BloombergLP/balxml/Reader/isEmptyElement.adoc[`isEmptyElement`]  [.small]#[virtual]#
| Return true if the current node is an empty element&period;
| xref:BloombergLP/balxml/Reader/isError.adoc[`isError`] 
| Return `true` if the derived object encountered a error&period; This method is equivalent to a call to `errorInfo()&period;isError()&semi;`
| xref:BloombergLP/balxml/Reader/isFatalError.adoc[`isFatalError`] 
| Return `true` if the derived object encountered a fatal error&period; This method is equivalent to a call to `errorInfo()&period;isFatalError()&semi;`
| xref:BloombergLP/balxml/Reader/isOpen.adoc[`isOpen`]  [.small]#[virtual]#
| Return true if `open` was called successfully and `close` has not yet been called and false otherwise&period;
| xref:BloombergLP/balxml/Reader/isWarning.adoc[`isWarning`] 
| Return `true` if the derived object encountered a warning&period; This method is equivalent to a call to `errorInfo()&period;isWarning()&semi;`
| xref:BloombergLP/balxml/Reader/lookupAttribute-0f.adoc[`lookupAttribute`] 
| `lookupAttribute` overloads
| xref:BloombergLP/balxml/Reader/nodeBaseUri.adoc[`nodeBaseUri`]  [.small]#[virtual]#
| Return the base URI of the current node&period;
| xref:BloombergLP/balxml/Reader/nodeDepth.adoc[`nodeDepth`]  [.small]#[virtual]#
| Return the nesting depth of the current node in the XML document&period; The root node has depth 0&period;
| xref:BloombergLP/balxml/Reader/nodeHasValue.adoc[`nodeHasValue`]  [.small]#[virtual]#
| Return true if the current node has a value and false otherwise&period;
| xref:BloombergLP/balxml/Reader/nodeLocalName.adoc[`nodeLocalName`]  [.small]#[virtual]#
| Return the local name of the current node&period;
| xref:BloombergLP/balxml/Reader/nodeName.adoc[`nodeName`]  [.small]#[virtual]#
| Return the qualified name of the current node&period;
| xref:BloombergLP/balxml/Reader/nodeNamespaceId.adoc[`nodeNamespaceId`]  [.small]#[virtual]#
| Return the namespace ID of the current node if the current node has a namespace id and a negative number otherwise&period;
| xref:BloombergLP/balxml/Reader/nodeNamespaceUri.adoc[`nodeNamespaceUri`]  [.small]#[virtual]#
| Return the namespace URI of the current node&period;
| xref:BloombergLP/balxml/Reader/nodePrefix.adoc[`nodePrefix`]  [.small]#[virtual]#
| Return the prefix name of the current node&period;
| xref:BloombergLP/balxml/Reader/nodeType-05.adoc[`nodeType`]  [.small]#[virtual]#
| Return the node type of the current node if the reader `isOpen` and has not encounter an error and `Reader&colon;&colon;NONE` otherwise&period;
| xref:BloombergLP/balxml/Reader/nodeValue.adoc[`nodeValue`]  [.small]#[virtual]#
| Return the value of the current node&period;
| xref:BloombergLP/balxml/Reader/numAttributes.adoc[`numAttributes`]  [.small]#[virtual]#
| Return the number of attributes for the current node if that node has attributes and 0 otherwise&period;
| xref:BloombergLP/balxml/Reader/open-0e.adoc[`open`] 
| `open` overloads
| xref:BloombergLP/balxml/Reader/options.adoc[`options`]  [.small]#[virtual]#
| Return the option flags&period;
| xref:BloombergLP/balxml/Reader/prefixStack.adoc[`prefixStack`]  [.small]#[virtual]#
| Return a pointer to the modifiable prefix stack used by this reader&period;
| xref:BloombergLP/balxml/Reader/resolver.adoc[`resolver`]  [.small]#[virtual]#
| Return the external XML resource resolver&period;
| xref:BloombergLP/balxml/Reader/setOptions.adoc[`setOptions`]  [.small]#[virtual]#
| Set the options to the flags in the specified `flags`&period;
| xref:BloombergLP/balxml/Reader/setPrefixStack.adoc[`setPrefixStack`]  [.small]#[virtual]#
| Set the prefix stack to the stack at the specified `prefixes` address&period;
| xref:BloombergLP/balxml/Reader/setResolver.adoc[`setResolver`]  [.small]#[virtual]#
| Set the external XML resource resolver to the specified `resolver`&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balxml/Reader/nodeTypeAsString.adoc[`nodeTypeAsString`] 
| Return a string representation for the specified `nodeType` code or &quot;(&ast; UNKNOWN NODE TYPE &ast;)&quot; if nodeType is not one of the values enumerated in `NodeType`&period;
|===


== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balxml/MiniReader.adoc[`MiniReader`] 
| This `class` provides a concrete and efficient implementation of the `Reader` protocol&period;
| xref:BloombergLP/balxml/Utf8ReaderWrapper.adoc[`Utf8ReaderWrapper`] 
| Wrap a `Reader` and check that its input is valid UTF&hyphen;8&period;
| xref:BloombergLP/balxml/ValidatingReader.adoc[`ValidatingReader`] 
| TBD Class description
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
