[#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‐Printable representation. == Synopsis Declared in `<bdlde_quotedprintabledecoder.h>` [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. Underscored enumerators apply in strict mode; others apply in relaxed mode where noted. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/LineBreakMode-08.adoc[`LineBreakMode`] | Configuration governing how hard line breaks (`"rn"`) are decoded. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlde/QuotedPrintableDecoder/2constructor.adoc[`QuotedPrintableDecoder`] [.small]#[constructor]# | Create a Quoted‐Printable decoder in the initial state, set to the strict or relaxed error‐reporting mode according to whether the specified `detectError` flag is `true` or `false`, respectively, and also configured to the specified `lineBreakMode`. The behavior is undefined unless `lineBreakMode` is either e_CRLF_MODE or e_LF_MODE. Note that the decoder reports errors in the strict mode and output offending characters in the relaxed mode. Hard line breaks (`\r `) are decoded to `\r ` in e_CRLF_MODE (default) and to ` ` in e_LF_MODE. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/2destructor.adoc[`~QuotedPrintableDecoder`] [.small]#[destructor]# | Destroy this object. | 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. If `maxNumOut` limit is reached, no further input will be consumed. Load into the specified `numOut` and `numIn` the number of output bytes produced and input bytes consumed, respectively. Return a non‐negative value on success and a negative value otherwise. 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. These bytes are also available for output if this method is called with a sufficiently large `maxNumOut`. 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. 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.g., whitespace). | xref:BloombergLP/bdlde/QuotedPrintableDecoder/endConvert.adoc[`endConvert`] | Terminate encoding for this decoder; write any retained output (e.g., from a previous call to `convert` with a non‐zero `maxNumOut` argument) to the specified `out` buffer. Optionally specify the `maxNumOut` limit on the number of bytes to output; if `maxNumOut` is negative, no limit is imposed. Load into the specified `numOut` the number of output bytes produced. 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. Any retained bytes are available on a subsequent call to `endConvert`. Once this method is called, no additional input may be supplied without an intervening call to `reset`; once this method returns a zero status, a subsequent call will place this decoder in the error state, and return an error status. | 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; return `false` otherwise. Note that there must not be any unprocessed characters accumulated in the input buffer of this decoder. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/isDone.adoc[`isDone`] | Return `true` if this decoder is in the done state (i.e., `endConvert` has been called and any additional input will result in an error), and if there is no pending output; return `false` otherwise. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/isError.adoc[`isError`] | Return `true` if this decoder has encountered an irrecoverable error and `false` otherwise. An irrecoverable error is one for which there is no subsequent possibility of achieving an "acceptable" result (as defined by the `isAccepting` method). | xref:BloombergLP/bdlde/QuotedPrintableDecoder/isInitialState.adoc[`isInitialState`] | Return `true` if this decoder is in the initial state (i.e., as if no input had been consumed) and `false` otherwise. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/isMaximal.adoc[`isMaximal`] | Return `true` if the input to this decoder is maximal (i.e., the input contains an end‐of‐input sentinel, signaling that no further input should be expected). _Always_ returns `false` for Quoted‐Printable decoders since the encoding scheme does not specify an end‐of‐input sentinel. | 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. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/lineBreakMode-02.adoc[`lineBreakMode`] | Return the line break mode specified for this decoder. | 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. | 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`. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/reset.adoc[`reset`] | Reset this decoder to its initial state (i.e., as if no input had been consumed). |=== == 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 ("rn"). The behavior is undefined unless `mode` is either e_CRLF_MODE or e_LF_MODE. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_buffer.adoc[`d_buffer`] | Pending input characters awaiting further decoding. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_bufferLength.adoc[`d_bufferLength`] | Number of valid characters currently stored in `d_buffer`. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_equivClass_p.adoc[`d_equivClass_p`] | Map of `unsigned char` to input equivalence class; dynamically allocated because there is no default complete configuration. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_hexBuffer.adoc[`d_hexBuffer`] | First hex digit buffered while decoding an `=XX` escape sequence. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_lineBreakMode.adoc[`d_lineBreakMode`] | How hard line breaks are decoded. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_outputLength.adoc[`d_outputLength`] | Total number of output characters produced so far. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_state.adoc[`d_state`] | Current decoder state‐machine state. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/d_unrecognizedIsErrorFlag.adoc[`d_unrecognizedIsErrorFlag`] | If `true`, unrecognized characters are treated as errors. |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_componentName.adoc[`s_componentName`] | Name of component used when reporting errors. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_decodingMap_p.adoc[`s_decodingMap_p`] | Character map used for converting an ASCII character to the hexadecimal value it is representing. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_defaultEquivClassCRLF_p.adoc[`s_defaultEquivClassCRLF_p`] | Default map of `unsigned char` to equivalence class for CRLF line break mode | xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_defaultEquivClassStrict_p.adoc[`s_defaultEquivClassStrict_p`] | Default map of `unsigned char` to equivalence class for strict mode | xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_defaultMaxLineLength.adoc[`s_defaultMaxLineLength`] | Default maximum line length used when configuring the decoder. | xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_defaultUnrecognizedIsErrorFlag.adoc[`s_defaultUnrecognizedIsErrorFlag`] | Default error reporting mode | xref:BloombergLP/bdlde/QuotedPrintableDecoder/s_lineBreakModeName.adoc[`s_lineBreakModeName`] | ASCII names corresponding to `LineBreakMode` enumerators. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#