zorba::hexbinary

Enumerations

decode_options

Options to use for decoding.

Type Definitions

size_t

size_type

Functions

bool

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.

Enumerations

decode_options

 decode_options

Options to use for decoding.

Type Definitions

size_type

size_t size_type

Functions

attach

bool 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.

Parameters

ios The stream to attach the hexbinary::streambuf to. If the stream already has a hexbinary::streambuf attached to it, this function does nothing.

Returns

true only if a hexbinary::streambuf was attached.

decode

size_type decode(char const *from, size_type from_len, char *to, int options=dopt_none)

Decodes a hexBinary-encoded buffer.

Parameters

from 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.

Returns

Returns the number of decoded bytes.

Parameters

invalid_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

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>.

Parameters

from 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.

Returns

Returns the number of decoded bytes.

Parameters

invalid_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

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.

Parameters

from 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.

Returns

Returns the number of decoded bytes.

Parameters

invalid_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

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.

Parameters

ToStringType The string type.

Parameters

from 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.

Returns

Returns the number of decoded bytes.

Parameters

invalid_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

size_type decode(std::istream &from, std::ostream &to, int options=dopt_none)

Decodes a hexBinary-encoded istream.

Parameters

from The istream to read from until EOF is reached.
to The ostream to write the decoded bytes to.
options The decoding options to use.

Returns

Returns the number of decoded bytes.

Parameters

invalid_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

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.

Parameters

ToStringType The string type.

Parameters

from 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

Returns the number of decoded bytes.

Parameters

invalid_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

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;>.

Parameters

from 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.

Parameters

invalid_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

size_type decoded_size(size_type n)

Calculates the number of bytes required to decode n hexBinary-encoded bytes.

Parameters

n The number of bytes to decode.

Returns

Returns the number of bytes needed for hexBinary decoding.

detach

bool 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.

Parameters

ios The stream to detach the hexbinary::streambuf from. If the stream doesn't have a hexbinary::streambuf attached to it, this function does nothing.

Returns

true only if a hexbinary::streambuf was detached.

encode

size_type encode(char const *from, size_type from_len, char *to)

HexBinary-encodes a buffer.

Parameters

from 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.

Returns

Returns the number of encoded bytes.

encode

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>.

Parameters

from 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.

encode

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.

Parameters

from 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.

Returns

Returns the number of encoded bytes.

encode

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.

Parameters

ToStringType The string type.

Parameters

from 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.

Returns

Returns the number of encoded bytes.

encode

size_type encode(std::istream &from, std::ostream &to)

HexBinary-encodes one stream and write the encoded bytes to another.

Parameters

from The istream to read from until EOF is reached.
to The ostream to write the encoded bytes to.

encode

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.

Parameters

ToStringType The string type.

Parameters

from The istream to read from until EOF is reached.
to The string to append the encoded bytes to.

Returns

Returns the number of encoded bytes.

encode

size_type encode(std::istream &from, std::vector< char > *to)

HexBinary-encodes a stream and appends the encoded bytes onto a vector<char;>.

Parameters

from 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

size_type encoded_size(size_type n)

Calculates the number of bytes required to hexBinary-encode n bytes.

Parameters

n The number of bytes to encode.

Returns

Returns the number of bytes needed for hexBinary encoding.

is_attached

bool is_attached(std::basic_ios< charT, Traits > &ios)

Checks whether the given stream has a hexbinary::streambuf attached.

Parameters

ios The stream to check.

Returns

true only if a hexbinary::streambuf is attached.

validate

void validate(char const *buf, size_type buf_len, int options=dopt_none)

Validates a hexBinary-encoded buffer.

Parameters

buf A pointer to the hexBinary buffer to be validated.
buf_len The number of bytes to validate.
options The decoding options to use.

Parameters

invalid_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.