Base64DecoderW.h File Reference

Decode base64 encoding. More...


Functions

XMIME_API void Base64DecoderW_start (Base64DecoderW *decoder)
 Starts a decode operation.
XMIME_API int Base64DecoderW_decode (Base64DecoderW *decoder, Char16Buffer *inBuf, ByteBuffer *outBuf)
 Decodes data from the input buffer to the output buffer.


Detailed Description

Base64DecoderW is a version of Base64Decoder that accepts text with 16-bit Unicode characters. The difference is that Base64DecoderW_decode() takes a Char16Buffer argument, while Base64Decoder_decode() takes a Char8Buffer argument. Base64DecoderW may be convenient to use with Java, .NET, or COM, where text most often consists of 16-bit Unicode characters.

If your program operates in an environment that uses the UTF-8 encoding of Unicode (Linux or Solaris, for example), then you can use the Base64Decoder module without any problems, because the base64-encoded data uses only 7-bit characters.

Please see the documentation for Base64Decoder.h.


Function Documentation

XMIME_API int Base64DecoderW_decode ( Base64DecoderW *  decoder,
Char16Buffer inBuf,
ByteBuffer outBuf 
)

Decodes data from the input buffer to the output buffer.

This function takes an input buffer and an output buffer as parameters, and decodes data from the input buffer to the output buffer until either (1) the input buffer is empty, (2) the output buffer is full, or (3) a decoding error occurs. Therefore, one of the following conditions is always true when the function returns:

  • inBuf.pos == inBuf.endPos (input buffer empty)
  • outBuf.pos == outBuf.endPos (output buffer full)
  • return value is -1 (decoding error occurred)

You may call the function multiple times to decode multiple buffers of input data. However, both of the following conditions should be true before the function is called:

  • inBuf.pos < inBuf.endPos (input buffer data available)
  • outBuf.pos < outBuf.endPos (output buffer space available)

If a decoding error occurs, the function returns -1. You must check the return value and abort the decode operation if a decoding error occurs.

Parameters:
decoder the decoder object
inBuf input buffer
outBuf output buffer
Returns:
0 if successful; -1 if a decoding error occurs

XMIME_API void Base64DecoderW_start ( Base64DecoderW *  decoder  ) 

Starts a decode operation.

After you call Base64DecoderW_start(), you call Base64DecoderW_decode() one or more times to complete the decode operation.

Parameters:
decoder the decoder object

Copyright © 2001-2010 Hunny Software, Inc. All rights reserved.