zorba::hexbinary
Functionsbool | attach(std::basic_ios< charT, Traits > &ios)
Attaches a hexbinary::streambuf to a stream. | size_type | decode(char const *from, size_type from_len, char *to, int options=dopt_none)
Decodes a hexBinary-encoded buffer. | size_type | decode(char const *from, size_type from_len, std::vector< char > *to, int options=dopt_none)
Decodes a hexBinary-encoded buffer and appends the decoded bytes onto a vector<char>. | ZORBA_DLL_PUBLIC size_type | decode(char const *from, size_type from_len, std::ostream &to, int options=dopt_none)
Decodes a hexBinary-encoded buffer and writes the decoded bytes to the given stream. | std::enable_if< ZORBA_IS_STRING(ToStringType), size_type >::type | decode(char const *from, size_type from_len, ToStringType *to, int options=dopt_none)
Decodes a hexBinary-encoded buffer and appends the decoded bytes onto a string. | size_type | decode(std::istream &from, std::ostream &to, int options=dopt_none)
Decodes a hexBinary-encoded istream. | std::enable_if< ZORBA_IS_STRING(ToStringType), size_type >::type | decode(std::istream &from, ToStringType *to, int options=dopt_none)
Decodes a hexBinary-encoded istream and appends the decoded bytes to a string. | size_type | decode(std::istream &from, std::vector< char > *to, int options=dopt_none)
Decodes a hexBinary-encoded stream and appends the decoded bytes onto a vector<char;>. | size_type | decoded_size(size_type n)
Calculates the number of bytes required to decode n hexBinary-encoded bytes. | bool | detach(std::basic_ios< charT, Traits > &ios)
Detaches a previously attached hexbinary::streambuf from a stream. | size_type | encode(char const *from, size_type from_len, char *to)
HexBinary-encodes a buffer. | size_type | encode(char const *from, size_type from_len, std::vector< char > *to)
HexBinary-encodes a buffer and appends the encoded bytes onto a vector<char>. | ZORBA_DLL_PUBLIC size_type | encode(char const *from, size_type from_len, std::ostream &to)
HexBinary-encodes a buffer and writes the encoded bytes to the given stream. | std::enable_if< ZORBA_IS_STRING(ToStringType), size_type >::type | encode(char const *from, size_type from_len, ToStringType *to)
HexBinary-encodes a buffer and appends the encoded bytes onto a string. | size_type | encode(std::istream &from, std::ostream &to)
HexBinary-encodes one stream and write the encoded bytes to another. | std::enable_if< ZORBA_IS_STRING(ToStringType), size_type >::type | encode(std::istream &from, ToStringType *to)
Encodes a stream to hexBinary and appends the encoded bytes to a string. | size_type | encode(std::istream &from, std::vector< char > *to)
HexBinary-encodes a stream and appends the encoded bytes onto a vector<char;>. | size_type | encoded_size(size_type n)
Calculates the number of bytes required to hexBinary-encode n bytes. | bool | is_attached(std::basic_ios< charT, Traits > &ios)
Checks whether the given stream has a hexbinary::streambuf attached. | void | validate(char const *buf, size_type buf_len, int options=dopt_none)
Validates a hexBinary-encoded buffer. |
Enumerationsdecode_options decode_options
Options to use for decoding.
Type Definitionssize_typesize_t size_type Functionsattachbool attach(std::basic_ios< charT, Traits > &ios)
Attaches a hexbinary::streambuf to a stream.
Unlike using a hexbinary::streambuf directly, this function will create the streambuf, attach it to the stream, and manage it for the lifetime of the stream automatically.
decodesize_type decode(char const *from, size_type from_len, char *to, int options=dopt_none)
Decodes a hexBinary-encoded buffer.
Parametersfrom |
A pointer to the hexBinary buffer to be decoded. | from_len |
The number of bytes to decode. to A pointer to the buffer to receive the decoded bytes. The buffer must be large enough to contain them. Note that the buffer is not null terminated. | options |
The decoding options to use. |
ReturnsReturns the number of decoded bytes.
Parametersinvalid_argument |
if from_len (minus the amount of whitespace if options contains dopt_ignore_ws) is not a multiple of 2. | |
if an invalid byte is encountered. |
decodesize_type decode(char const *from, size_type from_len, std::vector< char > *to, int options=dopt_none)
Decodes a hexBinary-encoded buffer and appends the decoded bytes onto a vector<char>.
Parametersfrom |
A pointer to the buffer to be encoded. | from_len |
The number of bytes to encode. | to |
A pointer to the vector to append the encoded bytes appended onto. The vector is made large enough to contain the additional bytes. | options |
The decoding options to use. |
ReturnsReturns the number of decoded bytes.
Parametersinvalid_argument |
if from_len (minus the amount of whitespace if options contains dopt_ignore_ws) is not a multiple of 2. | |
if an invalid byte is encountered. |
decodeZORBA_DLL_PUBLIC size_type decode(char const *from, size_type from_len, std::ostream &to, int options=dopt_none)
Decodes a hexBinary-encoded buffer and writes the decoded bytes to the given stream.
Parametersfrom |
A pointer to the hexBinary buffer to be decoded. | from_len |
The number of bytes to decode. | to |
The ostream to write the decoded bytes to. | options |
The options to use. |
ReturnsReturns the number of decoded bytes.
Parametersinvalid_argument |
if from_len (minus the amount of whitespace if options contains dopt_ignore_ws) is not a multiple of 2. | |
if an invalid byte is encountered. |
decode
Decodes a hexBinary-encoded buffer and appends the decoded bytes onto a string.
ParametersToStringType |
The string type. |
Parametersfrom |
A pointer to the hexBinary buffer to be decoded. | from_len |
The number of bytes to decode. | to |
The string to append the decoded bytes to. | options |
The decoding options to use. |
ReturnsReturns the number of decoded bytes.
Parametersinvalid_argument |
if from_len (minus the amount of whitespace if options contains dopt_ignore_ws) is not a multiple of 2. | |
if an invalid byte is encountered. |
decodesize_type decode(std::istream &from, std::ostream &to, int options=dopt_none)
Decodes a hexBinary-encoded istream.
Parametersfrom |
The istream to read from until EOF is reached. | to |
The ostream to write the decoded bytes to. | options |
The decoding options to use. |
ReturnsReturns the number of decoded bytes.
Parametersinvalid_argument |
if from_len (minus the amount of whitespace if options contains dopt_ignore_ws) is not a multiple of 2. | |
if an invalid byte is encountered. |
decode
Decodes a hexBinary-encoded istream and appends the decoded bytes to a string.
ParametersToStringType |
The string type. |
Parametersfrom |
The istream to read from until EOF is reached. | to |
The string to append the decoded bytes to. | options |
The decoding options to use. |
ReturnsReturns the number of decoded bytes.
Parametersinvalid_argument |
if from_len (minus the amount of whitespace if options contains dopt_ignore_ws) is not a multiple of 2. | |
if an invalid byte is encountered. |
decodesize_type decode(std::istream &from, std::vector< char > *to, int options=dopt_none)
Decodes a hexBinary-encoded stream and appends the decoded bytes onto a vector<char;>.
Parametersfrom |
The istream to read from until EOF is reached. | to |
The string to append the decoded bytes to. | options |
The decoding options to use. | Returns |
the number of decoded bytes. |
Parametersinvalid_argument |
if from_len (minus the amount of whitespace if options contains dopt_ignore_ws) is not a multiple of 2. | |
if an invalid byte is encountered. |
decoded_size
Calculates the number of bytes required to decode n hexBinary-encoded bytes.
Parametersn |
The number of bytes to decode. |
ReturnsReturns the number of bytes needed for hexBinary decoding.
detachbool detach(std::basic_ios< charT, Traits > &ios)
Detaches a previously attached hexbinary::streambuf from a stream.
The streambuf is destroyed and the stream's original streambuf is restored.
encodesize_type encode(char const *from, size_type from_len, char *to)
HexBinary-encodes a buffer.
Parametersfrom |
A pointer to the buffer to be encoded. | from_len |
The number of bytes to encode. | to |
A pointer to the buffer to receive the encoded bytes. The buffer must be large enough to contain them. Note that the buffer is not null terminated. |
ReturnsReturns the number of encoded bytes.
encodesize_type encode(char const *from, size_type from_len, std::vector< char > *to)
HexBinary-encodes a buffer and appends the encoded bytes onto a vector<char>.
Parametersfrom |
A pointer to the buffer to be encoded. | from_len |
The number of bytes to encode. | to |
A pointer to the vector to append the encoded bytes appended onto. The vector is made large enough to contain the additional bytes. |
encodeZORBA_DLL_PUBLIC size_type encode(char const *from, size_type from_len, std::ostream &to)
HexBinary-encodes a buffer and writes the encoded bytes to the given stream.
Parametersfrom |
A pointer to the buffer to be encoded. | from_len |
The number of bytes to encode. | to |
The ostream to write the encoded bytes to. |
ReturnsReturns the number of encoded bytes.
encode
HexBinary-encodes a buffer and appends the encoded bytes onto a string.
ParametersToStringType |
The string type. |
Parametersfrom |
A pointer to the buffer to be encoded. | from_len |
The number of bytes to encode. | to |
A pointer to the string to append the encoded bytes onto. |
ReturnsReturns the number of encoded bytes.
encodesize_type encode(std::istream &from, std::ostream &to)
HexBinary-encodes one stream and write the encoded bytes to another.
Parametersfrom |
The istream to read from until EOF is reached. | to |
The ostream to write the encoded bytes to. |
encode
Encodes a stream to hexBinary and appends the encoded bytes to a string.
ParametersToStringType |
The string type. |
Parametersfrom |
The istream to read from until EOF is reached. | to |
The string to append the encoded bytes to. |
ReturnsReturns the number of encoded bytes.
encodesize_type encode(std::istream &from, std::vector< char > *to)
HexBinary-encodes a stream and appends the encoded bytes onto a vector<char;>.
Parametersfrom |
The istream to read from until EOF is reached. | to |
The vector to append the encoded bytes to. | Returns |
the number of encoded bytes. |
encoded_size
Calculates the number of bytes required to hexBinary-encode n bytes.
Parametersn |
The number of bytes to encode. |
ReturnsReturns the number of bytes needed for hexBinary encoding.
is_attachedbool is_attached(std::basic_ios< charT, Traits > &ios) validatevoid validate(char const *buf, size_type buf_len, int options=dopt_none)
Validates a hexBinary-encoded buffer.
Parametersbuf |
A pointer to the hexBinary buffer to be validated. | buf_len |
The number of bytes to validate. | options |
The decoding options to use. |
Parametersinvalid_argument |
if from_len (minus the amount of whitespace if options contains dopt_ignore_ws) is not a multiple of 2. | |
if an invalid byte is encountered. |
|