Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

base64 Namespace Reference

holds some functions for encoding and decoding base64 data More...

Functions

const string Base64Table ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
 this lookup table defines the base64 encoding
string encode (char buf[], unsigned int len)
 returns a string containing the base64 encoding of len bytes from buf
unsigned int decodeSize (const std::string &data)
 returns the number of bytes which will be decoded from data
char * decode (const std::string &data)
 returns a pointer to a newly allocated region contained the binary data decoded from data
bool decode (const std::string &data, char buf[], unsigned int len)
 decodes data into buf, which you need to provide the size of in len

Variables

static const char fillchar = '='
 used to mark partial words at the end
static const string::size_type np = string::npos
 shorthand for the "no position" return code from string
const string::size_type DecodeTable []
 Decode Table gives the index of any valid base64 character in the Base64 table].

Detailed Description

holds some functions for encoding and decoding base64 data


Function Documentation

const string base64::Base64Table ( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"   ) 

this lookup table defines the base64 encoding

bool base64::decode ( const std::string &  data,
char  buf[],
unsigned int  len 
)

decodes data into buf, which you need to provide the size of in len

If buf is not large enough or data is malformed, false will be returned; otherwise true

char * base64::decode ( const std::string &  data  ) 

returns a pointer to a newly allocated region contained the binary data decoded from data

If data is malformed NULL will be returned

Referenced by LoadSave::checkCreator(), and LoadSave::decodeInc().

unsigned int base64::decodeSize ( const std::string &  data  ) 

returns the number of bytes which will be decoded from data

Does not check data for correctness, just counts the fill characters at the end of the string

std::string base64::encode ( char  buf[],
unsigned int  len 
)

Variable Documentation

const string::size_type base64::DecodeTable[]
Initial value:
 {
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,62,np,np,np,63,52,53,  
    54,55,56,57,58,59,60,61,np,np,  
    np,np,np,np,np, 0, 1, 2, 3, 4,  
    5, 6, 7, 8, 9,10,11,12,13,14,  
    15,16,17,18,19,20,21,22,23,24,  
    25,np,np,np,np,np,np,26,27,28,  
    29,30,31,32,33,34,35,36,37,38,  
    39,40,41,42,43,44,45,46,47,48,  
    49,50,51,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np,np,np,np,np,  
    np,np,np,np,np,np               
  }

Decode Table gives the index of any valid base64 character in the Base64 table].

65 == A, 97 == a, 48 == 0, 43 == +, 47 == /

Definition at line 37 of file Base64.cc.

const char base64::fillchar = '=' [static]

used to mark partial words at the end

Definition at line 29 of file Base64.cc.

const string::size_type base64::np = string::npos [static]

shorthand for the "no position" return code from string

Definition at line 30 of file Base64.cc.


Tekkotsu v5.1CVS
Generated Mon May 9 04:59:19 2016 by Doxygen 1.6.3