Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PBase64 Class Reference

#include <cypher.h>

Inheritance diagram for PBase64:


List of all members.

Detailed Description

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: {verbatim} PBase64 base; base.StartEncoding(); while (Read(dataChunk)) { base.ProcessEncoding(dataChunk); out << base.GetEncodedString(); } out << base.CompleteEncoding(); {verbatim}

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: {verbatim}

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

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

Definition at line 142 of file cypher.h.

Comparison functions

virtual Comparison Compare (const PObject &obj) const
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator>= (const PObject &obj) const
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
virtual BOOL InternalIsDescendant (const char *clsName) const
BOOL IsClass (const char *cls) const
static const char * Class ()

I/O functions

virtual void PrintOn (ostream &strm) const
virtual void ReadFrom (istream &strm)
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

Public Member Functions

PString CompleteEncoding ()
PBYTEArray GetDecodedData ()
BOOL GetDecodedData (void *dataBlock, PINDEX length)
PString GetEncodedString ()
BOOL IsDecodeOK ()
 PBase64 ()
BOOL ProcessDecoding (const char *cstr)
BOOL ProcessDecoding (const PString &str)
void ProcessEncoding (const void *dataBlock, PINDEX length)
void ProcessEncoding (const PBYTEArray &data)
void ProcessEncoding (const char *cstr)
void ProcessEncoding (const PString &str)
void StartDecoding ()
void StartEncoding (BOOL useCRLFs=TRUE)
Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const

Static Public Member Functions

static BOOL Decode (const PString &str, void *dataBlock, PINDEX length)
static BOOL Decode (const PString &str, PBYTEArray &data)
static PString Decode (const PString &str)
static PString Encode (const void *dataBlock, PINDEX length)
static PString Encode (const PBYTEArray &data)
static PString Encode (const char *cstr)
static PString Encode (const PString &str)

Private Member Functions

void OutputBase64 (const BYTE *data)
 PCLASSINFO (PBase64, PObject)

Private Attributes

PBYTEArray decodedData
PINDEX decodeSize
PString encodedString
PINDEX encodeLength
PINDEX nextLine
BOOL perfectDecode
PINDEX quadPosition
PINDEX saveCount
BYTE saveTriple [3]

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index