[#BloombergLP-balxml-Encoder_Context]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::Encoder&lowbar;Context
:relfileprefix: ../../
:mrdocs:

This `struct` contains state that is maintained during encoding&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Encoder&lowbar;Context;
----

== Description

It also contains methods for switching between pretty formatting and compact formatting, based on the encoding options&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balxml/Encoder_Context/2constructor.adoc[`Encoder&lowbar;Context`]         [.small]#[constructor]#
| Create a context bound to the specified `formatter` and `encoder`&period;
| xref:BloombergLP/balxml/Encoder_Context/addAttribute-01.adoc[`addAttribute`] 
| `addAttribute` overloads
| xref:BloombergLP/balxml/Encoder_Context/closeElement.adoc[`closeElement`] 
| Close the element with the specified `name`&period;
| xref:BloombergLP/balxml/Encoder_Context/encoderOptions.adoc[`encoderOptions`] 
| Return a reference to the encoder options in use&period;
| xref:BloombergLP/balxml/Encoder_Context/invalidate.adoc[`invalidate`] 
| Invalidate the current encoding state&period;
| xref:BloombergLP/balxml/Encoder_Context/logError.adoc[`logError`] 
| Log an encoding error or warning with the specified `text`, `tag`, `formattingMode`, and optional `index`&period;
| xref:BloombergLP/balxml/Encoder_Context/openElement.adoc[`openElement`] 
| Open an element with the specified `name`&period;
| xref:BloombergLP/balxml/Encoder_Context/rawOutputStream.adoc[`rawOutputStream`] 
| Return the raw output stream used by this context&period;
| xref:BloombergLP/balxml/Encoder_Context/status.adoc[`status`] 
| Return the current encoding status&period;
|===



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