Main Page | Data Structures | File List | Data Fields | Globals

Base64EncoderW.h File Reference


Detailed Description

Base64EncoderW is a version of Base64Encoder that outputs text with 16-bit Unicode characters. The difference is that Base64EncoderW_encode() and Base64EncoderW_finish() take a Char16Buffer argument, while Base64Encoder_encode() and Base64Encoder_finish() take a Char8Buffer argument. Base64EncoderW 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 Base64Encoder module without any problems, because the base64-encoded data uses only 7-bit characters.

Please see the documentation for Base64Encoder.


Functions

void Base64EncoderW_setMaxLineLen (Base64EncoderW *encoder, size_t n)
 Sets the maximum line length of the encoded output.
size_t Base64EncoderW_getMaxLineLen (Base64EncoderW *encoder)
 Gets the maximum line length of the encoded output.
void Base64EncoderW_setOutputCrLf (Base64EncoderW *encoder, int b)
 Sets the CRLF end-of-line characters option.
int Base64EncoderW_getOutputCrLf (Base64EncoderW *encoder)
 Gets the CRLF end-of-line characters option.
void Base64EncoderW_setSuppressFinalNewline (Base64EncoderW *encoder, int b)
 Sets the option to suppress a final newline in the output.
int Base64EncoderW_getSuppressFinalNewline (Base64EncoderW *encoder)
 Gets the option to suppress a final newline in the output.
void Base64EncoderW_initialize (Base64EncoderW *encoder)
 Initializes the encoder object.
void Base64EncoderW_start (Base64EncoderW *encoder)
 Starts an encode operation.
void Base64EncoderW_encode (Base64EncoderW *encoder, struct ByteBuffer *inBuf, struct Char16Buffer *outBuf)
 Encodes data from the input buffer to the output buffer.
void Base64EncoderW_finish (Base64EncoderW *encoder, struct Char16Buffer *outBuf)
 Finishes an encode operation.


Function Documentation

size_t Base64EncoderW_getMaxLineLen Base64EncoderW *  encoder  ) 
 

Gets the maximum line length of the encoded output.

Parameters:
encoder the encoder object
Returns:
maximum line length of the encoded output

int Base64EncoderW_getOutputCrLf Base64EncoderW *  encoder  ) 
 

Gets the CRLF end-of-line characters option.

Parameters:
encoder the encoder object
Returns:
boolean value of this option

int Base64EncoderW_getSuppressFinalNewline Base64EncoderW *  encoder  ) 
 

Gets the option to suppress a final newline in the output.

Parameters:
encoder the encoder object
Returns:
boolean value of this option

void Base64EncoderW_initialize Base64EncoderW *  encoder  ) 
 

Initializes the encoder object.

You must initialize the encoder object before you use it. After you have initialized it, you may use the encoder object for multiple encode operations.

Parameters:
encoder the encoder object

void Base64EncoderW_setMaxLineLen Base64EncoderW *  encoder,
size_t  len
 

Sets the maximum line length of the encoded output.

For MIME-compliant Internet mail, lines may be no longer than 76 characters. However, applications other than mail might allow lines longer than 76 characters. You may call Base64EncoderW_setMaxLineLen() to change the maximum line length to a value appropriate for your application. You may even force output without any line breaks by setting the maximum line length to a very large value (for example, 0x7FFFFFFF) and by setting the Suppress Final Newline option to true.

This function enforces the restriction that the maximum line length be a multiple of 4. If the argument is not a multiple of 4, then it is rounded down to the nearest multiple of 4.

The default value is 72.

Parameters:
encoder the encoder object
len maximum line length in the encoded output

void Base64EncoderW_setOutputCrLf Base64EncoderW *  encoder,
int  b
 

Sets the CRLF end-of-line characters option.

If this option is true, then the encoder uses CR LF as the end-of-line characters in the encoded output. If the option is false, then the encoder uses LF alone.

The default value is false.

Parameters:
encoder the encoder object
b true value causes CR LF in the output; false causes LF

void Base64EncoderW_setSuppressFinalNewline Base64EncoderW *  encoder,
int  b
 

Sets the option to suppress a final newline in the output.

If this option is true, then the encoder does not put a final newline (CR LF, or LF) at the end of the encoded output, unless the last line of output is a full line. If the option is false, then the encoder always adds a newline to the end of the encoded output, even if the last line is a partial line. If you don't want any end-of-line characters in the output, you may set this option to true and set the Maximum Line Length to a very large value.

The default value is false.

Parameters:
encoder the encoder object
b if true, a final newline will be suppressed; if false, a final newline is always added

void Base64EncoderW_start Base64EncoderW *  encoder  ) 
 

Starts an encode operation.

After you call Base64EncoderW_start(), you call Base64EncoderW_encode() one or more times, followed by Base64EncoderW_finish() to complete the encode operation.

Parameters:
encoder the encoder object

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