ldas-tools-al
2.6.7
|
Base 64 Conversion. More...
#include <base64.hh>
Public Types | |
typedef LDASTools::AL::bit_vector | bit_vector |
typedef LDASTools::AL::bit_vector | bit_vector |
typedef LDASTools::AL::bit_vector | bit_vector |
Static Public Member Functions | |
static size_t | encode (std::string &Destination, const bit_vector &Source) |
Encode bit_vector. More... | |
static size_t | encode (char *destination, const void *source, size_t size) |
Encode generic 8 bit data. More... | |
static size_t | decode (bit_vector &Destination, const std::string &Source) |
Decode bit_vector. More... | |
static size_t | decode (void *destination, const char *source) |
Decode generic 8 bit data. More... | |
static size_t | calculateEncodedSize (size_t bytes) |
Compute number of output bytes given the number of input bytes. More... | |
static size_t | calculateDecodedSize (const char *s) |
Compute number of output bytes given a null terminated string. More... | |
static void | setNumCharactersPerLine (const int num) |
Establish the number of characters per line. More... | |
static size_t | encode (std::string &Destination, const bit_vector &Source) |
Encode bit_vector. More... | |
static size_t | encode (char *destination, const void *source, size_t size) |
Encode generic 8 bit data. More... | |
static size_t | decode (bit_vector &Destination, const std::string &Source) |
Decode bit_vector. More... | |
static size_t | decode (void *destination, const char *source) |
Decode generic 8 bit data. More... | |
static size_t | calculateEncodedSize (size_t bytes) |
Compute number of output bytes given the number of input bytes. More... | |
static size_t | calculateDecodedSize (const char *s) |
Compute number of output bytes given a null terminated string. More... | |
static void | setNumCharactersPerLine (const int num) |
Establish the number of characters per line. More... | |
static size_t | encode (std::string &Destination, const bit_vector &Source) |
Encode bit_vector. More... | |
static size_t | encode (char *destination, const void *source, size_t size) |
Encode generic 8 bit data. More... | |
static size_t | decode (bit_vector &Destination, const std::string &Source) |
Decode bit_vector. More... | |
static size_t | decode (void *destination, const char *source) |
Decode generic 8 bit data. More... | |
static size_t | calculateEncodedSize (size_t bytes) |
Compute number of output bytes given the number of input bytes. More... | |
static size_t | calculateDecodedSize (const char *s) |
Compute number of output bytes given a null terminated string. More... | |
static void | setNumCharactersPerLine (const int num) |
Establish the number of characters per line. More... | |
Static Private Member Functions | |
static bool | getChar (const char **source, unsigned char &c) |
Get next Base64 value. More... | |
static bool | getChar (const char **source, unsigned char &c) |
Get next Base64 value. More... | |
static bool | getChar (const char **source, unsigned char &c) |
Get next Base64 value. More... | |
Static Private Attributes | |
static const char * | mTable |
Base 64 translation table. More... | |
static int | mCharsPerLine |
Number of characters per line. More... | |
Base 64 Conversion.
This class is used to convert to and from Base 64. Base 64 is a way to encode binary data using printable ASCII characters. It uses 4 characters for every 3 bytes.
This is a static class.
|
static |
Compute number of output bytes given a null terminated string.
Calculate Decoded Size.
Calculates the number of bytes which the passed Base-64 string will decode into.
s | The string to check. |
|
static |
Compute number of output bytes given a null terminated string.
|
static |
Compute number of output bytes given a null terminated string.
Compute number of output bytes given the number of input bytes.
Calculate Encoded Size.
Calculates the number of characters required to represent the requested number of bytes in Base-64. This does not include the null-terminator.
size | The number of bytes to encode. |
Compute number of output bytes given the number of input bytes.
Compute number of output bytes given the number of input bytes.
|
static |
Decode bit_vector.
Decode base64 data back into a bit_vector
Destination | Storage space for decoded data |
Source | Storage space for the encoded data |
|
static |
Decode bit_vector.
|
static |
Decode bit_vector.
|
static |
Decode generic 8 bit data.
This translates a Base-64 encoded string into binary data.
destination | The location to write the decoded data. This must be large enough to store the data. The required size can be calculated via the 'calculateDecodedSize' method. |
source | Base64 data. Decoding will stop when the first non-Base64 character, an '=', or a null terminator occurs. |
|
static |
Decode generic 8 bit data.
|
static |
Decode generic 8 bit data.
Encode generic 8 bit data.
Encodes Base64.
This method translates a block of binary data into Base-64 encoded data. The encoded data is stored in the memory location provided by the user. This destination buffer must be large enough to store the result. The user may calculate what the size needs to be via the calculateEncodedSize method (be sure to add 1 for the null character). This method appends a null character to the end of the encoded string.
destination | The buffer in which to store the encoded data. |
source | The buffer to encode. |
size | The number of bytes in the buffer. |
Encode generic 8 bit data.
Encode generic 8 bit data.
|
static |
Encode bit_vector.
[out] | Destination | The buffer to hold the base 64 encoded result. |
[in] | Source | The buffer holding the 8-bit data to encode. |
|
static |
Encode bit_vector.
|
static |
Encode bit_vector.
|
staticprivate |
Get next Base64 value.
source | The address of the pointer to the next Base-64 character in the string. The pointer will be updated by this method as it searches along the string. |
c | The value of the next Base64 character found (0-63). If a character was not found, the value is |
|
staticprivate |
Get next Base64 value.
|
staticprivate |
Get next Base64 value.
|
static |
Establish the number of characters per line.
Set number of characters per line.
Sets number of characters per line for the encoded data.
num | Number of characters. |
|
static |
Establish the number of characters per line.
|
static |
Establish the number of characters per line.
|
staticprivate |
Number of characters per line.
Default is 76 (based on MIME).
|
staticprivate |
Base 64 translation table.
An array containing the Base64 characters in order.