Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

Uuencode Class Reference

List of all members.

Detailed Description

Uuencode performs uuencode or uudecode operations. Uuencode is a format for encoding binary data into text characters for transmission through the mail system. The format also includes the file name and the file mode. (Note: The file mode is significant only on UNIX-like systems.) In MIME, the use of uuencode is deprecated; base64 is the preferred encoding for sending binary data.

To use Uuencode for encoding binary data into uuencode format, set the file name, file mode, and binary data string using the member functions setFileName(), setFileMode(), and setBinaryChars(). Then call the member function encode(). Finally, retrieve the uuencoded text characters by calling asciiChars().

To use Uuencode to decode uuencoded data, set the ASCII characters using the member function setAsciiChars(), then call decode(). Finally, retrieve the file name, file mode, and binary characters by calling fileName(), fileMode(), and binaryChars().


Public Member Functions

 Uuencode ()
 Default constructor.
virtual ~Uuencode ()
 Destructor.
void setFileName (const char *name)
 Sets the file name.
const char * fileName () const
 Gets the file name.
void setFileMode (uint16_t mode)
 Sets the file mode.
uint16_t fileMode () const
 Gets the file mode.
void setBinaryChars (const String &bytes)
 Sets the binary file content.
const StringbinaryChars () const
 Gets the binary file content.
void setAsciiChars (const String &chars)
 Sets the encoded characters.
const StringasciiChars () const
 Gets the encoded characters.
void encode ()
 Performs the encode operation.
int decode ()
 Performs the decode operation.


Constructor & Destructor Documentation

Uuencode  ) 
 

Default constructor

~Uuencode  )  [virtual]
 

Destructor


Member Function Documentation

const String & asciiChars  )  const
 

Gets the encoded characters.

Returns:
the encoded characters

const String & binaryChars  )  const
 

Gets the binary file content

Returns:
the bytes of the file content

int decode  ) 
 

Extracts the file name, file mode, and binary data from the ASCII characters via a uudecode operation.

Returns:
0 on success; -1 on failure

void encode  ) 
 

Creates an ASCII string of characters by uuencoding the file name, file mode, and binary data.

uint16_t fileMode  )  const
 

Gets the file mode.

Returns:
the file mode

const char * fileName  )  const
 

Gets the file name.

The implementation limits the file name to 255 characters.

Returns:
the file name

void setAsciiChars const String chars  ) 
 

Sets the encoded characters.

Parameters:
chars the encoded characters

void setBinaryChars const String bytes  ) 
 

Sets the binary file content.

Parameters:
bytes the bytes of the file content

void setFileMode uint16_t  mode  ) 
 

Sets the file mode.

If the file mode is not explicitly set using this member function, a default value of 0644 (octal) is assumed.

Parameters:
mode the file mode

void setFileName const char *  name  ) 
 

Sets the file name.

The implementation limits the file name to 255 characters.

Parameters:
name the file name

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