[#BloombergLP-bdlde-QuotedPrintableDecoder]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::QuotedPrintableDecoder
:relfileprefix: ../../
:mrdocs:

This class implements a mechanism capable of converting data of arbitrary length from its corresponding Quoted&hyphen;Printable representation&period;

== Synopsis

Declared in `&lt;bdlde&lowbar;quotedprintabledecoder&period;h&gt;`

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

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/EquivalenceClasses.adoc[`EquivalenceClasses`] 
| Input character equivalence classes used by the decoder state machine&period; Underscored enumerators apply in strict mode&semi; others apply in relaxed mode where noted&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/LineBreakMode-08.adoc[`LineBreakMode`] 
| Configuration governing how hard line breaks (`&quot;rn&quot;`) are decoded&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/2constructor.adoc[`QuotedPrintableDecoder`]         [.small]#[constructor]#
| Create a Quoted&hyphen;Printable decoder in the initial state, set to the strict or relaxed error&hyphen;reporting mode according to whether the specified `detectError` flag is `true` or `false`, respectively, and also configured to the specified `lineBreakMode`&period; The behavior is undefined unless `lineBreakMode` is either e&lowbar;CRLF&lowbar;MODE or e&lowbar;LF&lowbar;MODE&period; Note that the decoder reports errors in the strict mode and output offending characters in the relaxed mode&period; Hard line breaks (&grave;&bsol;r &grave;) are decoded to &grave;&bsol;r ` in e&lowbar;CRLF&lowbar;MODE (default) and to `
&grave; in e&lowbar;LF&lowbar;MODE&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/2destructor.adoc[`&#126;QuotedPrintableDecoder`] [.small]#[destructor]#
| Destroy this object&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/convert.adoc[`convert`] 
| Append to the buffer addressed by the specified `out` all pending output (if there is any) up to the optionally specified `maxNumOut` limit (default is negative, meaning no limit) and, when there is no pending output and `maxNumOut` is still not reached, begin to consume and decode a sequence of input characters starting at the specified `begin` position, up to but not including the specified `end` position, writing any resulting output in the specified `output` buffer up to the (cumulative) `maxNumOut` limit&period; If `maxNumOut` limit is reached, no further input will be consumed&period; Load into the specified `numOut` and `numIn` the number of output bytes produced and input bytes consumed, respectively&period; Return a non&hyphen;negative value on success and a negative value otherwise&period; A successful return status indicates the number of characters that would be output if `endConvert` were called with no output limit immediately upon exit from this method&period; These bytes are also available for output if this method is called with a sufficiently large `maxNumOut`&period; Note that calling this method after `endConvert` has been invoked without an intervening `reset` call will place this instance in an error state, and return an error status&period; Note also that it is recommended that after all calls to `convert` are finished, the `endConvert` method be called to complete the decoding of any unprocessed input characters (e&period;g&period;, whitespace)&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/endConvert.adoc[`endConvert`] 
| Terminate encoding for this decoder&semi; write any retained output (e&period;g&period;, from a previous call to `convert` with a non&hyphen;zero `maxNumOut` argument) to the specified `out` buffer&period; Optionally specify the `maxNumOut` limit on the number of bytes to output&semi; if `maxNumOut` is negative, no limit is imposed&period; Load into the specified `numOut` the number of output bytes produced&period; Return 0 on success with no pending output, the positive number of bytes (if any) that would be output if `endConvert` were called with no output limit immediately upon exit from this method, and a negative value otherwise&period; Any retained bytes are available on a subsequent call to `endConvert`&period; Once this method is called, no additional input may be supplied without an intervening call to `reset`&semi; once this method returns a zero status, a subsequent call will place this decoder in the error state, and return an error status&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/isAccepting.adoc[`isAccepting`] 
| Return `true` if the input read so far by this decoder is considered syntactically complete and all resulting output has been emitted&semi; return `false` otherwise&period; Note that there must not be any unprocessed characters accumulated in the input buffer of this decoder&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/isDone.adoc[`isDone`] 
| Return `true` if this decoder is in the done state (i&period;e&period;, `endConvert` has been called and any additional input will result in an error), and if there is no pending output&semi; return `false` otherwise&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/isError.adoc[`isError`] 
| Return `true` if this decoder has encountered an irrecoverable error and `false` otherwise&period; An irrecoverable error is one for which there is no subsequent possibility of achieving an &quot;acceptable&quot; result (as defined by the `isAccepting` method)&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/isInitialState.adoc[`isInitialState`] 
| Return `true` if this decoder is in the initial state (i&period;e&period;, as if no input had been consumed) and `false` otherwise&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/isMaximal.adoc[`isMaximal`] 
| Return `true` if the input to this decoder is maximal (i&period;e&period;, the input contains an end&hyphen;of&hyphen;input sentinel, signaling that no further input should be expected)&period; _Always_ returns `false` for Quoted&hyphen;Printable decoders since the encoding scheme does not specify an end&hyphen;of&hyphen;input sentinel&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/isUnrecognizedAnError.adoc[`isUnrecognizedAnError`] 
| Return `true` if this decoder is currently configured to detect an error when an unrecognizable encoding is encountered, and `false` otherwise&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/lineBreakMode-02.adoc[`lineBreakMode`] 
| Return the line break mode specified for this decoder&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/numOutputPending.adoc[`numOutputPending`] 
| Return the number of output bytes retained by this decoder and not emitted because `maxNumOut` has been reached&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/outputLength.adoc[`outputLength`] 
| Return the total length of the output emitted by this decoder (possibly after several calls to the `convert` or the `input` methods) since its initial construction or the latest `reset`&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/reset.adoc[`reset`] 
| Reset this decoder to its initial state (i&period;e&period;, as if no input had been consumed)&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/lineBreakModeToAscii.adoc[`lineBreakModeToAscii`] 
| Return the ASCII string describing the specified `mode` governing the decoding of hard linebreaks (&quot;rn&quot;)&period; The behavior is undefined unless `mode` is either e&lowbar;CRLF&lowbar;MODE or e&lowbar;LF&lowbar;MODE&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_buffer.adoc[`d&lowbar;buffer`] 
| Pending input characters awaiting further decoding&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_bufferLength.adoc[`d&lowbar;bufferLength`] 
| Number of valid characters currently stored in `d&lowbar;buffer`&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_equivClass_p.adoc[`d&lowbar;equivClass&lowbar;p`] 
| Map of `unsigned char` to input equivalence class&semi; dynamically allocated because there is no default complete configuration&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_hexBuffer.adoc[`d&lowbar;hexBuffer`] 
| First hex digit buffered while decoding an `&equals;XX` escape sequence&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_lineBreakMode.adoc[`d&lowbar;lineBreakMode`] 
| How hard line breaks are decoded&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_outputLength.adoc[`d&lowbar;outputLength`] 
| Total number of output characters produced so far&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_state.adoc[`d&lowbar;state`] 
| Current decoder state&hyphen;machine state&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_unrecognizedIsErrorFlag.adoc[`d&lowbar;unrecognizedIsErrorFlag`] 
| If `true`, unrecognized characters are treated as errors&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_componentName.adoc[`s&lowbar;componentName`] 
| Name of component used when reporting errors&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_decodingMap_p.adoc[`s&lowbar;decodingMap&lowbar;p`] 
| Character map used for converting an ASCII character to the hexadecimal value it is representing&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_defaultEquivClassCRLF_p.adoc[`s&lowbar;defaultEquivClassCRLF&lowbar;p`] 
| Default map of `unsigned char` to equivalence class for CRLF line break mode
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_defaultEquivClassStrict_p.adoc[`s&lowbar;defaultEquivClassStrict&lowbar;p`] 
| Default map of `unsigned char` to equivalence class for strict mode
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_defaultMaxLineLength.adoc[`s&lowbar;defaultMaxLineLength`] 
| Default maximum line length used when configuring the decoder&period;
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_defaultUnrecognizedIsErrorFlag.adoc[`s&lowbar;defaultUnrecognizedIsErrorFlag`] 
| Default error reporting mode
| xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_lineBreakModeName.adoc[`s&lowbar;lineBreakModeName`] 
| ASCII names corresponding to `LineBreakMode` enumerators&period;
|===



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