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

This function converts a base64 string of characters back into its orginal form.

This decoding decreases the size of of the input by 1/3 (i.e., converts every group of 4 bytes into 3 bytes). The resulting value can be in text or a binary format. Note, that it is possible to decode in place, that is the parameters "pInb64" and "pDecoded" can point to the SAME buffer.

This function also decodes the modified base64 algorithm as described in the encodeBlockURLSafe() function below.

The base64 definition calls for textual data that is used for input to the encoding algorithm to have its line termination normalized. That is, line termination is to be converted to a carriage return followed by a line feed. Then when the decoding process is performed the normalized line termination is converted to the local machine format. This line terimation conversion is not performed by this function.

Parameters
pInb64[IN] Pointer to a buffer containing base64 ASCII text
pDecoded[OUT] The data pointed to by pInb64 decoded out of base64 and into its orginal form
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::eInvalidArgpInb64 is NULL or cBuffer is zero. If both pDecoded and pWritten are NULL.
P6R::eFormatErrorA non-base64 character found in the pInb64 parameter.
P6R::eTooSmallThe buffer pEncoded is too small to contain the generated value.
P6R::eNotInitializedA successful call to initialize has not been done.