[#BloombergLP-balxml-Reader-open-0e] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::xref:BloombergLP/balxml/Reader.adoc[Reader]::open :relfileprefix: ../../../ :mrdocs: `open` overloads == Synopses Declared in `<balxml_reader.h>` Set up the reader for parsing using the data contained in the XML file described by the specified `filename`, and set the encoding value to the optionally specified `encoding` ("ASCII", "UTF‐8", etc). Returns 0 on success and non‐zero otherwise. The encoding passed to `Reader::open` will take effect only when there is no encoding information in the original document, i.e., the encoding information obtained from the XML file described by the `filename` trumps all. If there is no encoding provided within the document and `encoding` is null or a blank string is passed, then set the encoding to the default "UTF‐8". It is an error to `open` a reader that is already open. Note that the reader will not be on a valid node until `advanceToNextNode` is called. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- virtual int xref:BloombergLP/balxml/Reader/open-07.adoc[open]( char const* filename, char const* encoding = 0) = 0; ---- [.small]#xref:BloombergLP/balxml/Reader/open-07.adoc[_» more..._]# Set up the reader for parsing using the data contained in the specified (XML) `stream`, set the base URL to the optionally specified `url` and set the encoding value to the optionally specified `encoding` ("ASCII", "UTF‐8", etc). Return 0 on success and non‐zero otherwise. If `url` is null or a blank string is passed, then base URL will be empty. The encoding passed to `Reader::open` will take effect only when there is no encoding information in the original document, i.e., the encoding information obtained from the (XML) `stream` trumps all. If there is no encoding provided within the document and `encoding` is null or a blank string is passed, then set the encoding to the default "UTF‐8". It is an error to `open` a reader that is already open. Note that the reader will not be on a valid node until `advanceToNextNode` is called. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- virtual int xref:BloombergLP/balxml/Reader/open-03.adoc[open]( std::streambuf* stream, char const* url = 0, char const* encoding = 0) = 0; ---- [.small]#xref:BloombergLP/balxml/Reader/open-03.adoc[_» more..._]# Set up the reader for parsing using the data contained in the specified (XML) `buffer` of the specified `size`, set the base URL to the optionally specified `url` and set the encoding value to the optionally specified `encoding` ("ASCII", "UTF‐8", etc). Return 0 on success and non‐zero otherwise. If `url` is null or a blank string is passed, then base URL will be empty. The encoding passed to `Reader::open` will take effect only when there is no encoding information in the original document, i.e., the encoding information obtained from the (XML) `buffer` trumps all. If there is no encoding provided within the document and `encoding` is null or a blank string is passed, then set the encoding to the default "UTF‐8". It is an error to `open` a reader that is already open. Note that the reader will not be on a valid node until `advanceToNextNode` is called. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- virtual int xref:BloombergLP/balxml/Reader/open-09.adoc[open]( char const* buffer, std::size_t size, char const* url = 0, char const* encoding = 0) = 0; ---- [.small]#xref:BloombergLP/balxml/Reader/open-09.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#