fintp_utils
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FinTP::Base64 Class Reference

Implement decode and encode function for base64. More...

#include <Base64.h>

Static Public Member Functions

static string encode (const string &data)
 Encodes the given string data. More...
 
static string encode (const unsigned char *data, const unsigned int size)
 Encodes the first <size> bytes of the given buffer. More...
 
static string decode (const string &data)
 Decodes given data. More...
 
static string decode (const unsigned char *data, const unsigned int size)
 Decodes given data with the specified size. More...
 
static unsigned int encodedLength (const string &data)
 Returns the length of the encoded data. More...
 
static unsigned int encodedLength (const unsigned char *data, const unsigned int size)
 Returns the length of the encoded data. More...
 
static unsigned int decodedLength (const string &data)
 Returns the length of the decoded data given as a param. More...
 
static unsigned int decodedLength (const unsigned char *data, const unsigned int size)
 Returns the length of the decoded data given as a param. More...
 
static bool isBase64 (const string &text)
 Return TRUE if input text is in base64 format, FALSE otherwise. More...
 

Static Private Attributes

static string m_Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
 The alphabet to use for encode/decode operations. More...
 
static char m_FillChar = '='
 Character to fill the output when the length isn't 4 multiplier. More...
 

Detailed Description

Implement decode and encode function for base64.

Author
Horia Beschea

Member Function Documentation

string Base64::decode ( const string &  data)
static

Decodes given data.

Parameters
[in]dataData to be decoded in base64 format
Returns
The decoded string
string Base64::decode ( const unsigned char *  data,
const unsigned int  size 
)
static

Decodes given data with the specified size.

Parameters
[in]dataThe string to be decoded
[in]sizeNumber of characters to be decoded
Returns
The decoded data
unsigned int Base64::decodedLength ( const string &  data)
static

Returns the length of the decoded data given as a param.

Parameters
[in]dataString to be decoded and return it's length
Returns
The length of the decoded data
unsigned int Base64::decodedLength ( const unsigned char *  data,
const unsigned int  size 
)
static

Returns the length of the decoded data given as a param.

Parameters
[in]dataString to be decoded and return it's length 'param[in] size Number of characters to decode from input string
Returns
The length of the decoded data
string Base64::encode ( const string &  data)
static

Encodes the given string data.

Parameters
[in]dataInput data to encode
Returns
Encoded string in base64 format
string Base64::encode ( const unsigned char *  data,
const unsigned int  size 
)
static

Encodes the first <size> bytes of the given buffer.

Parameters
[in]dataThe string to be encoded
[in]sizeNumber of characters to be encoded
Returns
The encoded string
unsigned int Base64::encodedLength ( const string &  data)
static

Returns the length of the encoded data.

Parameters
[in]dataString to be encoded and return it's length
Returns
The length of the encoded data
unsigned int Base64::encodedLength ( const unsigned char *  data,
const unsigned int  size 
)
static

Returns the length of the encoded data.

Parameters
[in]dataString to be encoded and return it's length
[in]sizeNumber of characters to encode from input string
Returns
The length of the encoded data
bool Base64::isBase64 ( const string &  text)
static

Return TRUE if input text is in base64 format, FALSE otherwise.

Parameters
[in]textInput string to be tested
Returns
TRUE if input text is in base64 format, FALSE otherwise

Member Data Documentation

string Base64::m_Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
staticprivate

The alphabet to use for encode/decode operations.

char Base64::m_FillChar = '='
staticprivate

Character to fill the output when the length isn't 4 multiplier.


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