Download Source Code

CBase64 Class Reference

For standard base-64 encoding and decoding. More...

#include <Base64.h>

List of all members.

Public Member Functions

 CBase64 ()
 Default Constructor.
virtual ~CBase64 ()
 Destructor.

Static Public Member Functions

static DWORD Encode (LPSTR dst, DWORD dstsize, LPBYTE src, DWORD srcsize)
 Encode data as base-64 string with CRLF.
static BOOL Decode (LPCTSTR src, LPDWORD srcsize, LPBYTE dst, LPDWORD dstsize, LPDWORD done)
 Decode base-64 string.
static DWORD GetEncodedSize (DWORD size)
 Calculates size of encoded string.
static DWORD GetDecodedSize (DWORD size)
 Calculates size of decoded string.

Static Public Attributes

static BYTE m_b64encode []
 Base-64 encoding lookup table.
static BYTE m_b64decode []
 Base-64 decode lookup table.


Detailed Description

For standard base-64 encoding and decoding.

All functions of this class are static. It is therefore, not necessary to create an instance of this class.


Member Function Documentation

BOOL CBase64::Decode LPCTSTR  src,
LPDWORD  srcsize,
LPBYTE  dst,
LPDWORD  dstsize,
LPDWORD  done
[static]
 

Decode base-64 string.

Parameters:
[in] src - Data to be decoded
[in] srcsize - Size of src
[in] dst - Receives decoded data
[in] dstsize - Size of dst
[out] done - Set to non-zero when decoding is done
Returns:
Returns number of bytes decoded

DWORD CBase64::Encode LPSTR  dst,
DWORD  dstsize,
LPBYTE  src,
DWORD  srcsize
[static]
 

Encode data as base-64 string with CRLF.

Parameters:
[in] dst - Receives encoded string
[in] dstsize - Size of dst
[in] src - Data to be encoded
[in] srcsize - Size of src
Returns:
Returns number of bytes encoded
Warning:
For multiple calls, size must be divisible by four

static DWORD CBase64::GetDecodedSize DWORD  size  )  [inline, static]
 

Calculates size of decoded string.

Parameters:
[in] size - Size of encoded data
Returns:
Returns calculated size of unencoded string
Warning:
For multiple calls, must be divisible by four

static DWORD CBase64::GetEncodedSize DWORD  size  )  [inline, static]
 

Calculates size of encoded string.

Parameters:
[in] size - Size of unencoded data
Returns:
Returns calculated size of encoded string
Warning:
For multiple calls, must be divisible by four


The documentation for this class was generated from the following files:
  • inc/Base64.h
  • Base64.cpp
Copyright Robert Umbehant
This documentation is covered by the LGPL