radarlib 1.4.6
Radar::Base64 Class Reference

Base64 encoding class. More...

#include <radarlib/base64.hpp>

Static Public Member Functions

static size_t encodeSize (size_t buffsize)
 Calculate the length of the base64 string that would result converting a buffer large 'buffsize' bytes.
 
static void encode (std::string &b64str, const void *buff, size_t buffsize)
 Encode a buffer into a std::string.
 
static size_t decodeSize (const std::string &b64str)
 Calculate the length of the binary buffer that would result deconverting the indicated base64 string.
 
static unsigned char * decode (const std::string &b64str)
 Decode a base64 string allocating a new buffer.
 
static unsigned char * decode (const std::string &b64str, size_t *resultSize)
 Decode a base64 string allocating a new buffer.
 
static void decode (std::vector< unsigned char > &result, const std::string &b64str)
 Decode a base64 string into an existing std::vector.
 

Detailed Description

Base64 encoding class.


This class provide functions to encode and decode strings and buffers
acording to Base 64 format.

Member Function Documentation

◆ encodeSize()

size_t Radar::Base64::encodeSize ( size_t  buffsize)
static

Calculate the length of the base64 string that would result converting a buffer large 'buffsize' bytes.

Parameters
buffsizethe binary buffer length (in bytes)

◆ encode()

void Radar::Base64::encode ( std::string &  b64str,
const void *  buff,
size_t  buffsize 
)
static

Encode a buffer into a std::string.

Parameters
b64strthe destination string variable
buffthe binary buffer
buffsizethe binary buffer length (in bytes)

◆ decodeSize()

size_t Radar::Base64::decodeSize ( const std::string &  b64str)
static

Calculate the length of the binary buffer that would result deconverting the indicated base64 string.

Parameters
b64strthe encoded string

◆ decode() [1/3]

unsigned char * Radar::Base64::decode ( const std::string &  b64str)
static

Decode a base64 string allocating a new buffer.

Parameters
b64strthe encoded string

◆ decode() [2/3]

unsigned char * Radar::Base64::decode ( const std::string &  b64str,
size_t *  resultSize 
)
static

Decode a base64 string allocating a new buffer.

Parameters
b64strthe encoded string
resultSizea pointer to a variabile that will store the size of the allocated buffer

◆ decode() [3/3]

void Radar::Base64::decode ( std::vector< unsigned char > &  result,
const std::string &  b64str 
)
static

Decode a base64 string into an existing std::vector.

Parameters
resultthe result vector that will store the decoded binary data
b64strthe encoded string

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