#include <bdlde_quotedprintabledecoder.h>
|
| enum | EquivalenceClasses {
e_RC_ = 0
, e_RC
, e_HX_
, e_HX
,
e_EQ_
, e_EQ
, e_WS_
, e_WS
,
e_CR_
, e_CR
, e_LC_
, e_LL_
,
e_LC
, e_LL
, e_UC_
, e_UC
,
BDEDE_RC_ = e_RC_
, BDEDE_RC = e_RC
, BDEDE_HX_ = e_HX_
, BDEDE_HX = e_HX
,
BDEDE_EQ_ = e_EQ_
, BDEDE_EQ = e_EQ
, BDEDE_WS_ = e_WS_
, BDEDE_WS = e_WS
,
BDEDE_CR_ = e_CR_
, BDEDE_CR = e_CR
, BDEDE_LC_ = e_LC_
, BDEDE_LL_ = e_LL_
,
BDEDE_LC = e_LC
, BDEDE_LL = e_LL
, BDEDE_UC_ = e_UC_
, BDEDE_UC = e_UC
} |
| |
| enum | LineBreakMode { e_CRLF_MODE
, e_LF_MODE
, BDEDE_CRLF_MODE = e_CRLF_MODE
, BDEDE_LF_MODE = e_LF_MODE
} |
| |
This class implements a mechanism capable of converting data of arbitrary length from its corresponding Quoted-Printable representation.
See bdlde_quotedprintabledecoder
◆ EquivalenceClasses
| Enumerator |
|---|
| e_RC_ | |
| e_RC | |
| e_HX_ | |
| e_HX | |
| e_EQ_ | |
| e_EQ | |
| e_WS_ | |
| e_WS | |
| e_CR_ | |
| e_CR | |
| e_LC_ | |
| e_LL_ | |
| e_LC | |
| e_LL | |
| e_UC_ | |
| e_UC | |
| BDEDE_RC_ | |
| BDEDE_RC | |
| BDEDE_HX_ | |
| BDEDE_HX | |
| BDEDE_EQ_ | |
| BDEDE_EQ | |
| BDEDE_WS_ | |
| BDEDE_WS | |
| BDEDE_CR_ | |
| BDEDE_CR | |
| BDEDE_LC_ | |
| BDEDE_LL_ | |
| BDEDE_LC | |
| BDEDE_LL | |
| BDEDE_UC_ | |
| BDEDE_UC | |
◆ LineBreakMode
| Enumerator |
|---|
| e_CRLF_MODE | |
| e_LF_MODE | |
| BDEDE_CRLF_MODE | |
| BDEDE_LF_MODE | |
◆ QuotedPrintableDecoder()
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\n") are decoded to "\r\n" in e_CRLF_MODE (default) and to '
' in e_LF_MODE.
◆ ~QuotedPrintableDecoder()
| bdlde::QuotedPrintableDecoder::~QuotedPrintableDecoder |
( |
| ) |
|
◆ convert()
| int bdlde::QuotedPrintableDecoder::convert |
( |
char * |
out, |
|
|
int * |
numOut, |
|
|
int * |
numIn, |
|
|
const char * |
begin, |
|
|
const char * |
end, |
|
|
int |
maxNumOut = -1 |
|
) |
| |
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).
◆ endConvert()
| int bdlde::QuotedPrintableDecoder::endConvert |
( |
char * |
out, |
|
|
int * |
numOut, |
|
|
int |
maxNumOut = -1 |
|
) |
| |
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.
◆ isAccepting()
| bool bdlde::QuotedPrintableDecoder::isAccepting |
( |
| ) |
const |
|
inline |
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.
◆ isDone()
| bool bdlde::QuotedPrintableDecoder::isDone |
( |
| ) |
const |
|
inline |
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.
◆ isError()
| bool bdlde::QuotedPrintableDecoder::isError |
( |
| ) |
const |
|
inline |
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).
◆ isInitialState()
| bool bdlde::QuotedPrintableDecoder::isInitialState |
( |
| ) |
const |
|
inline |
Return true if this decoder is in the initial state (i.e., as if no input had been consumed) and false otherwise.
◆ isMaximal()
| bool bdlde::QuotedPrintableDecoder::isMaximal |
( |
| ) |
const |
|
inline |
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.
◆ isUnrecognizedAnError()
| bool bdlde::QuotedPrintableDecoder::isUnrecognizedAnError |
( |
| ) |
const |
|
inline |
Return true if this decoder is currently configured to detect an error when an unrecognizable encoding is encountered, and false otherwise.
◆ lineBreakMode()
◆ lineBreakModeToAscii()
| const char * bdlde::QuotedPrintableDecoder::lineBreakModeToAscii |
( |
LineBreakMode |
mode | ) |
|
|
inlinestatic |
Return the ASCII string describing the specified mode governing the decoding of hard linebreaks ("\r\n"). The behavior is undefined unless mode is either e_CRLF_MODE or e_LF_MODE.
◆ numOutputPending()
| int bdlde::QuotedPrintableDecoder::numOutputPending |
( |
| ) |
const |
|
inline |
Return the number of output bytes retained by this decoder and not emitted because maxNumOut has been reached.
◆ outputLength()
| int bdlde::QuotedPrintableDecoder::outputLength |
( |
| ) |
const |
|
inline |
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.
◆ reset()
| void bdlde::QuotedPrintableDecoder::reset |
( |
| ) |
|
|
inline |
Reset this decoder to its initial state (i.e., as if no input had been consumed).
◆ d_buffer
| char bdlde::QuotedPrintableDecoder::d_buffer[90] |
◆ d_bufferLength
| int bdlde::QuotedPrintableDecoder::d_bufferLength |
◆ d_equivClass_p
| char* bdlde::QuotedPrintableDecoder::d_equivClass_p |
◆ d_hexBuffer
| char bdlde::QuotedPrintableDecoder::d_hexBuffer |
◆ d_lineBreakMode
◆ d_outputLength
| int bdlde::QuotedPrintableDecoder::d_outputLength |
◆ d_state
| int bdlde::QuotedPrintableDecoder::d_state |
◆ d_unrecognizedIsErrorFlag
| bool bdlde::QuotedPrintableDecoder::d_unrecognizedIsErrorFlag |
◆ s_componentName
| const char bdlde::QuotedPrintableDecoder::s_componentName[] |
|
static |
◆ s_decodingMap_p
| const unsigned char* const bdlde::QuotedPrintableDecoder::s_decodingMap_p |
|
static |
Character map used for converting an ASCII character to the hexadecimal value it is representing.
◆ s_defaultEquivClassCRLF_p
| const char* bdlde::QuotedPrintableDecoder::s_defaultEquivClassCRLF_p |
|
static |
Default map of unsigned char to equivalence class for CRLF line break mode
◆ s_defaultEquivClassStrict_p
| const char* bdlde::QuotedPrintableDecoder::s_defaultEquivClassStrict_p |
|
static |
◆ s_defaultMaxLineLength
| const int bdlde::QuotedPrintableDecoder::s_defaultMaxLineLength |
|
static |
◆ s_defaultUnrecognizedIsErrorFlag
| const bool bdlde::QuotedPrintableDecoder::s_defaultUnrecognizedIsErrorFlag |
|
static |
◆ s_lineBreakModeName
| const char* bdlde::QuotedPrintableDecoder::s_lineBreakModeName[] |
|
static |
The documentation for this class was generated from the following file: