class PBase64

This class is used to encode/decode data using the MIME standard base64 encoding mechanism as defined in RFC1521.

Inheritance:


Public Methods

[more] PBase64 ()
Construct a base 64 encoder/decoder and initialise both encode and decode members as in StartEncoding() and StartDecoding()
[more]PString GetEncodedString ()
Get the partial Base64 string for the data encoded so far.
[more]PString CompleteEncoding ()
Complete the base 64 encoding and return the remainder of the encoded Base64 string.
[more]BOOL ProcessDecoding ( const PString & str )
Incorporate the specified data into the base 64 decoding.
[more]BOOL GetDecodedData ( void* dataBlock, PINDEX length )
Get the data decoded so far from the Base64 strings processed.
[more]BOOL IsDecodeOK ()
Return a flag to indicate that the input was decoded without any extraneous or illegal characters in it that were ignored.
[more]static PString Decode ( const PString & str )
Convert a printable text string to binary data using the Internet MIME standard base 64 content transfer encoding.


Inherited from PObject:

Public Methods

Run Time Type functions

I/O functions

Public Members

Comparison functions


Documentation

This class is used to encode/decode data using the MIME standard base64 encoding mechanism as defined in RFC1521.

To encode a large block of data use the following seqeunce:

      PBase64 base;
      base.StartEncoding();
      while (Read(dataChunk)) {
        base.ProcessEncoding(dataChunk);
        out << base.GetEncodedString();
      }
      out << base.CompleteEncoding();

if smaller blocks that fit easily in memory are to be encoded the Encode() functions can be used to everything in one go.

To decode a large block of data use the following sequence:


      PBase64 base;
      base.StartDecoding();
      while (Read(str) && ProcessDecoding(str))
        Write(base.GetDecodedData());
      Write(base.GetDecodedData());

if smaller blocks that fit easily in memory are to be decoded the Decode() functions can be used to everything in one go.

o PBase64()
Construct a base 64 encoder/decoder and initialise both encode and decode members as in StartEncoding() and StartDecoding()

oPString GetEncodedString()
Get the partial Base64 string for the data encoded so far.

Returns:
Base64 encoded string for the processed data.

oPString CompleteEncoding()
Complete the base 64 encoding and return the remainder of the encoded Base64 string. Previous data may have been already removed by the GetInterim() function.

Returns:
Base64 encoded string for the processed data.

oBOOL ProcessDecoding( const PString & str )
Incorporate the specified data into the base 64 decoding.

Returns:
TRUE if block was last in the Base64 encoded string.

oBOOL GetDecodedData( void* dataBlock, PINDEX length )
Get the data decoded so far from the Base64 strings processed.

Returns:
Decoded data for the processed Base64 string.

oBOOL IsDecodeOK()
Return a flag to indicate that the input was decoded without any extraneous or illegal characters in it that were ignored. This does not mean that the data is not valid, only that it is suspect.

Returns:
Decoded data for the processed Base64 string.

ostatic PString Decode( const PString & str )
Convert a printable text string to binary data using the Internet MIME standard base 64 content transfer encoding.

The base64 string is checked and TRUE returned if all perfectly correct. If FALSE is returned then the string had extraneous or illegal characters in it that were ignored. This does not mean that the data is not valid, only that it is suspect.

Returns:
Base 64 string decoded from input string.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.