Wrap a Reader and check that its input is valid UTF‐8.

Synopsis

Declared in <balxml_utf8readerwrapper.h>

class Utf8ReaderWrapper
    : public Reader

Description

This class "has a" pointer to a held and wrapped Reader object, and operations on this object are passed to the held reader. The held reader is passed a Utf8CheckingInStreamBufWrapper, which holds and wraps a normal streambuf. The Utf8CheckingInStreamBufWrapper checks input for invalid UTF‐8, and if it detects any, makes the diagnosis of the problem available through the errorInfo accessor.

Base Classes

Name

Description

Reader

This abstract class defines an interface for fast, forward‐only access to XML data.

Type Aliases

Name

Description

StreamBufPtr

Managed pointer to a bsl::streambuf used for external entity input.

XmlResolverFunctor

Type for a user‐supplied functor that opens an external XML resource.

Enums

Name

Description

NodeType

Node types returned by nodeType, representing XML syntactic constructs within a document. Not every Reader implementation distinguishes all node types.

Member Functions

Name

Description

Utf8ReaderWrapper [constructor]

Create a Utf8ReaderWrapper that holds the specified reader.

~Utf8ReaderWrapper [destructor] [virtual]

Close the held reader and destroy this object.

advanceToNextNode [virtual]

Move to the next node in the data stream created by open.

allocator

Return the allocator used by this object to allocate memory.

close [virtual]

Close the reader.

documentEncoding [virtual]

Return the document encoding or NULL on error.

dumpNode

Print the information about the current node to the specified output os stream.

errorInfo [virtual]

Return a reference to the non‐modifiable error information for this reader. The returned value becomes invalid when close is called or the reader is destroyed.

getColumnNumber [virtual]

Return the current column number within the input stream.

getLineNumber [virtual]

Return the current line number within the input stream.

isEmptyElement [virtual]

Return true if the current node is an empty element.

isError

Return true if the derived object encountered a error. This method is equivalent to a call to errorInfo().isError();

isFatalError

Return true if the derived object encountered a fatal error. This method is equivalent to a call to errorInfo().isFatalError();

isOpen [virtual]

Return true if open was called successfully and close has not yet been called and false otherwise.

isWarning

Return true if the derived object encountered a warning. This method is equivalent to a call to errorInfo().isWarning();

lookupAttribute

lookupAttribute overloads

nodeBaseUri [virtual]

Return the base URI of the current node.

nodeDepth [virtual]

Return the nesting depth of the current node in the XML document. The root node has depth 0.

nodeHasValue [virtual]

Return true if the current node has a value and false otherwise.

nodeLocalName [virtual]

Return the local name of the current node.

nodeName [virtual]

Return the qualified name of the current node.

nodeNamespaceId [virtual]

Return the namespace ID of the current node if the current node has a namespace id and a negative number otherwise.

nodeNamespaceUri [virtual]

Return the namespace URI of the current node.

nodePrefix [virtual]

Return the prefix name of the current node.

nodeType [virtual]

Return the node type of the current node if the reader isOpen and has not encounter an error and Reader::NONE otherwise.

nodeValue [virtual]

Return the value of the current node.

numAttributes [virtual]

Return the number of attributes for the current node if that node has attributes and 0 otherwise.

open

open overloads

options [virtual]

Return the option flags.

prefixStack [virtual]

Return a pointer to the modifiable prefix stack used by this reader.

resolver [virtual]

Return the external XML resource resolver.

setOptions [virtual]

Set the options of the held reader to the flags in the specified flags.

setPrefixStack [virtual]

Set the prefix stack to the stack at the specified prefixes address.

setResolver [virtual]

Set the external XML resource resolver to the specified resolver.

operator BloombergLP::bslmf::NestedTraitDeclaration<Utf8ReaderWrapper, UsesBslmaAllocator>

Utf8ReaderWrapper uses a bslma allocator.

Static Member Functions

Name

Description

nodeTypeAsString

Return a string representation for the specified nodeType code or "(* UNKNOWN NODE TYPE *)" if nodeType is not one of the values enumerated in NodeType.

Created with MrDocs