BloombergLP::bdlde::HexEncoder::convert

Append to the buffer addressed by the specified out pending character (if there is such) up to the optionally specified maxNumOut limit (default is negative, meaning no limit). When there is no pending output and maxNumOut is still not reached, begin to consume and encode a sequence of input characters starting at the specified begin position, up to but not including the specified end position. Any resulting output is written to the out buffer up to the (cumulative) maxNumOut limit. If maxNumOut limit is reached, no further input will be consumed. Load into the (optionally) 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 subsequently with no output limit. These bytes may be 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 encoding of any unprocessed input characters.

Synopses

Declared in <bdlde_hexencoder.h>

Append to the buffer addressed by the specified out pending character (if there is such) up to the optionally specified maxNumOut limit (default is negative, meaning no limit). When there is no pending output and maxNumOut is still not reached, begin to consume and encode a sequence of input characters starting at the specified begin position, up to but not including the specified end position. Any resulting output is written to the out buffer up to the (cumulative) maxNumOut limit. If maxNumOut limit is reached, no further input will be consumed. Load into the (optionally) 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 subsequently with no output limit. These bytes may be 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 encoding of any unprocessed input characters.

template<
    class OUTPUT_ITERATOR,
    class INPUT_ITERATOR>
int
convert(
    OUTPUT_ITERATOR out,
    INPUT_ITERATOR begin,
    INPUT_ITERATOR end);
» more...
template<
    class OUTPUT_ITERATOR,
    class INPUT_ITERATOR>
int
convert(
    OUTPUT_ITERATOR out,
    int* numOut,
    int* numIn,
    INPUT_ITERATOR begin,
    INPUT_ITERATOR end,
    int maxNumOut = -1);
» more...