Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IBinhex::hex2bin ( const P6CHAR pHex,
P6UCHAR pDecoded,
P6UINT32  cBuffer,
P6UINT32 pWritten 
)
pure virtual

This function converts a hexadecimal character string into a buffer of binary data.

The hexadecimal encoding scheme is typically used to convert a binary blob into a character string for some type of storage or network transfer. This function undoes the encoding. This function does not handle any line termination characters in the pHex input parameter.

The parameter pDecoded can be set to NULL. In this case, this function returns the buffer size required to perform the decode operation in the pWritten parameter.

Parameters
pHex[ in ] Pointer to a buffer containing hexadecimal encoded data
pDecoded[ out ] The data pointed to by pHex decoded into its orginal form. This pointer can be NULL.
cBuffer[ in ] Number of bytes in the buffer pointed to by pDecoded.
pWritten[ out ] Optional can be NULL, returns the number of bytes written into pDecoded. This parameter cannot be NULL when pDecoded is also NULL.
Returns
SuccessP6R::eOk 
FailureP6R::eInvalidArgpHex is NULL or cBuffer is zero. Or both pHex and pWritten are NULL.
P6R::eTooSmallThe buffer pDecoded is too small to contain the generated value.
P6R::eNotInitializedA successful call to initialize has not been done.
P6R::eFormatErrorThe data pointed to by pHex is not proper hexadecimal (e.g., invalid character or of wrong length).