DUNE: Uniform Navigational Environment  2017.01.0
DUNE::Algorithms::Base64 Class Reference

Detailed Description

Base64 encoding and decoding as defined by RFC 2045.

Static Public Member Functions

static std::string encode (const std::string &str)
 
static std::string encode (const char *str, size_t len)
 
static std::string encode (const unsigned char *bytes, size_t len)
 
static std::string decode (const std::string &str)
 
static std::string decode (const char *str, size_t len)
 
static std::string decode (const unsigned char *bytes, size_t len)
 
static bool validBase64 (const std::string &str)
 
static bool validBase64 (const char *str)
 

Member Function Documentation

static std::string DUNE::Algorithms::Base64::decode ( const std::string &  str)
inlinestatic

Decode a sequence of bytes in Base64.

Parameters
[in]strsource string.
Returns
Base64 decoded string.

Referenced by decode().

static std::string DUNE::Algorithms::Base64::decode ( const char *  str,
size_t  len 
)
inlinestatic

Decode a sequence of bytes in Base64.

Parameters
[in]strsource string.
[in]lenlength of the string.
Returns
Base64 encoded string.

References decode().

std::string DUNE::Algorithms::Base64::decode ( const unsigned char *  bytes,
size_t  len 
)
static

Decode a sequence of bytes in Base64.

Parameters
[in]bytesunsigned char.
[in]lenlength of the string.
Returns
Base64 encoded string.
static std::string DUNE::Algorithms::Base64::encode ( const std::string &  str)
inlinestatic

Encode a sequence of bytes in Base64.

Parameters
[in]strsource string.
Returns
Base64 encoded string.

Referenced by encode().

static std::string DUNE::Algorithms::Base64::encode ( const char *  str,
size_t  len 
)
inlinestatic

Encode a sequence of bytes in Base64.

Parameters
[in]strsource string.
[in]lenlength of the string.
Returns
Base64 encoded string.

References encode().

std::string DUNE::Algorithms::Base64::encode ( const unsigned char *  bytes,
size_t  len 
)
static

Encode a sequence of bytes in Base64.

Parameters
[in]bytesunsigned char.
[in]lenlength of the string.
Returns
Base64 encoded string.
static bool DUNE::Algorithms::Base64::validBase64 ( const std::string &  str)
inlinestatic

Verify if a string is decoded in Base64.

Parameters
[in]strsource string.
Returns
true if string is decoded in Base64.
bool DUNE::Algorithms::Base64::validBase64 ( const char *  str)
static

Verify if a string is decoded in Base64.

Verify if string is a valid Base64.

Parameters
[in]strsource string.
Returns
true if string is decoded in Base64.
Collaboration diagram for DUNE::Algorithms::Base64:
Collaboration graph