CBase64Buffer Class Reference

#include <Base64Buffer.h>

Collaboration diagram for CBase64Buffer:

Collaboration graph
[legend]

List of all members.


Detailed Description

This is a helper class used to encode and decode base 64 data.

TSP-enforcing: No

Definition at line 21 of file Base64Buffer.h.


Public Member Functions

 CBase64Buffer ()
virtual ~CBase64Buffer ()
bool decode (const char *in, const unsigned long inLen, unsigned char *out, unsigned long *outLen)
bool encode (const unsigned char *in, const unsigned long inLen, char *out, unsigned long *outLen)
void addLineBreaks (int addLineBreaksAt, bool addCarriageReturn=true)
bool prependChars (const char *sz)

Protected Attributes

int m_addLineBreaks
char * m_prependChars
bool m_addCR

Static Protected Attributes

static unsigned char m_base64chars [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
static unsigned int m_bitMask [] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 }
static int m_decodeTable []

Constructor & Destructor Documentation

CBase64Buffer::CBase64Buffer (  ) 

Interface: External

Constructor for CBase64Buffer class

Returns:
None

Definition at line 39 of file Base64Buffer.cpp.

References m_addCR, m_addLineBreaks, m_base64chars, m_decodeTable, and m_prependChars.

CBase64Buffer::~CBase64Buffer (  )  [virtual]

Interface: External

Destructor for CBase64Buffer class

Returns:
None

Definition at line 66 of file Base64Buffer.cpp.

References m_prependChars.


Member Function Documentation

bool CBase64Buffer::decode ( const char *  in,
const unsigned long  inLen,
unsigned char *  out,
unsigned long *  outLen 
)

Interface: External

This function decodes base 64 buffer.

The size of the output buffer must not be less than 3/4 the size of the input buffer.

Returns:
True is successfull

Definition at line 241 of file Base64Buffer.cpp.

References c, COMMON_INVALID_INPUT, m_decodeTable, and TOOLKIT_PATH.

Referenced by B64Decode().

bool CBase64Buffer::encode ( const unsigned char *  in,
const unsigned long  inLen,
char *  out,
unsigned long *  outLen 
)

Interface: External

This function ecodes into base 64

Returns:
True is successfull

Definition at line 78 of file Base64Buffer.cpp.

References COMMON_INVALID_INPUT, m_addCR, m_addLineBreaks, m_base64chars, m_bitMask, m_prependChars, and TOOLKIT_PATH.

Referenced by B64Encode().

void CBase64Buffer::addLineBreaks ( int  addLineBreaks,
bool  addCarriageReturn = true 
)

Interface: External

This this helper function addes line breaks.

Returns:
None

Definition at line 311 of file Base64Buffer.cpp.

References m_addCR, and m_addLineBreaks.

bool CBase64Buffer::prependChars ( const char *  sz  ) 

Interface: External

This this helper function prepends Characters

Returns:
None

Definition at line 335 of file Base64Buffer.cpp.

References m_prependChars.


Member Data Documentation

Definition at line 34 of file Base64Buffer.h.

Referenced by addLineBreaks(), CBase64Buffer(), and encode().

char* CBase64Buffer::m_prependChars [protected]

Definition at line 35 of file Base64Buffer.h.

Referenced by CBase64Buffer(), encode(), prependChars(), and ~CBase64Buffer().

bool CBase64Buffer::m_addCR [protected]

Definition at line 36 of file Base64Buffer.h.

Referenced by addLineBreaks(), CBase64Buffer(), and encode().

unsigned char CBase64Buffer::m_base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [static, protected]

Definition at line 38 of file Base64Buffer.h.

Referenced by CBase64Buffer(), and encode().

unsigned int CBase64Buffer::m_bitMask = { 0, 1, 3, 7, 15, 31, 63, 127, 255 } [static, protected]

Definition at line 39 of file Base64Buffer.h.

Referenced by encode().

int CBase64Buffer::m_decodeTable [static, protected]

Definition at line 40 of file Base64Buffer.h.

Referenced by CBase64Buffer(), and decode().


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

Generated on Mon Nov 15 11:19:47 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6