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

`PrefixStack` allows associating a unique integer (namespace ID) with prefix&period;

== Synopsis

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

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

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balxml/PrefixStack/2constructor-02.adoc[`PrefixStack`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/balxml/PrefixStack/2destructor.adoc[`&#126;PrefixStack`] [.small]#[destructor]#
| Destroy this object&period;
| xref:BloombergLP/balxml/PrefixStack/lookupNamespaceId.adoc[`lookupNamespaceId`] 
| Return ID of the namespace registered for the specified `prefix` or &hyphen;1 if not registered&period;
| xref:BloombergLP/balxml/PrefixStack/lookupNamespacePrefix.adoc[`lookupNamespacePrefix`] 
| Return a copy of the specified `prefix` if `prefix` is registered or an empty string if `prefix` is not registered&period;
| xref:BloombergLP/balxml/PrefixStack/lookupNamespaceUri-06.adoc[`lookupNamespaceUri`] 
| `lookupNamespaceUri` overloads
| xref:BloombergLP/balxml/PrefixStack/namespaceIdByIndex.adoc[`namespaceIdByIndex`] 
| Return the namespace ID at the specified `index` in the prefix stack, where an `index` of 0 is the oldest ID on the stack&period; If `index` is negative, return the ID at position &apos;numPrefixes() &hyphen; index&apos;&period; Thus, an `index` of &hyphen;1 will return the most recent ID on the stack (i&period;e&period;, the top of the stack)&period; The behavior is undefined if `index &gt; numPrefixes()` or `index &lt; &hyphen;numPrefixes()`&period;
| xref:BloombergLP/balxml/PrefixStack/namespacePrefixByIndex.adoc[`namespacePrefixByIndex`] 
| Return the namespace prefix at the specified `index` in the prefix stack, where an `index` of 0 is the oldest prefix on the stack&period; If `index` is negative, return the prefix at position &apos;numPrefixes() &hyphen; index&apos;&period; Thus, an `index` of &hyphen;1 will return the most recent prefix on the stack (i&period;e&period;, the top of the stack)&period; The behavior is undefined if `index &gt; numPrefixes()` or `index &lt; &hyphen;numPrefixes()`&period;
| xref:BloombergLP/balxml/PrefixStack/namespaceRegistry.adoc[`namespaceRegistry`] 
| Return the pointer of `NamespaceRegistry` associated with this PrefixStack&period;
| xref:BloombergLP/balxml/PrefixStack/namespaceUriByIndex.adoc[`namespaceUriByIndex`] 
| Return the namespace URI at the specified `index` in the prefix stack, where an `index` of 0 is the oldest URI on the stack&period; If `index` is negative, return the URI at position &apos;numPrefixes() &hyphen; index&apos;&period; Thus, an `index` of &hyphen;1 will return the most recent URI on the stack (i&period;e&period;, the top of the stack)&period; The behavior is undefined if `index &gt; numPrefixes()` or `index &lt; &hyphen;numPrefixes()`&period;
| xref:BloombergLP/balxml/PrefixStack/numPrefixes.adoc[`numPrefixes`] 
| Return the current number of prefixes in the stack&period;
| xref:BloombergLP/balxml/PrefixStack/popPrefixes.adoc[`popPrefixes`] 
| Remove the specified last `count` number prefixes&period; Return the number of actually removed prefixes&period;
| xref:BloombergLP/balxml/PrefixStack/print.adoc[`print`] 
| Print the content of this object to the specified `stream`&period; The optionally specified `fullNames` specifies how namespaces should be printed&colon; `true` for the full names and `false` only for IDs&period;
| xref:BloombergLP/balxml/PrefixStack/pushPrefix.adoc[`pushPrefix`] 
| Map the specified `namespaceUri` to the specified `prefix` and return the namespace Id&period; New mapping eclipses previous mapping&period;
| xref:BloombergLP/balxml/PrefixStack/reset.adoc[`reset`] 
| Removes all prefixes from the internal collection&period;
| xref:BloombergLP/balxml/PrefixStack/restoreToSize.adoc[`restoreToSize`] 
| Restore stack to the specified `size`&period; The behavior is undefined if PrefixStack contains fewer prefixes than requested size&period;
|===



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