#include <base64.h>
Collaboration diagram for Base64Decoder:
Public Member Functions | |
Base64Decoder () | |
Construct a base-64 decoder. | |
Base64Decoder (const Base64Decoder &b) | |
Copy-constructor as usual. | |
~Base64Decoder () | |
Destructor; a no-op... | |
Base64Decoder & | operator= (const Base64Decoder &b) |
Standard assignment operator:. | |
void | reset () |
Reset the decoder. | |
size_t | DecodedSize (size_t inlen) |
Compute the required output buffer length. | |
ssize_t | decode (const char *in, size_t inlen, char *out, size_t outlen) |
Decode base-64 ASCII as binary data. | |
Static Public Member Functions | |
ssize_t | DecodeBuf (const char *in, size_t inlen, char *out, size_t outlen) |
Static version of decoding function. | |
Private Attributes | |
uint32 | state |
Current decode state (carry). |
Definition at line 134 of file base64.h.
|
Construct a base-64 decoder.
Definition at line 141 of file base64.h. References state. |
|
Copy-constructor as usual.
Definition at line 143 of file base64.h. References state. |
|
Destructor; a no-op...
|
|
Decode base-64 ASCII as binary data. You can decode very large data by calling this function repeatedly since this class has an internal state which saves the carry bytes from previous calls. In order to have the carry flushed and all data appended to the output buffer, either call the function with inlen=0 or make sure that the end-of-input indicator ('=') is at the end of the base64 encoded input. You can use the static variant DecodeBuf() if you can decode all data in a single call.
Definition at line 260 of file base64.cc. References ssize_t, and state. Referenced by base64_ctest(). |
|
Static version of decoding function. See the member function decode() for details. Definition at line 266 of file base64.cc. References ssize_t. |
|
Compute the required output buffer length. Computes the length of the output buffer when decoding input of size inlen. The returned value may be slightly too large but never too small. |
|
Standard assignment operator:.
Definition at line 148 of file base64.h. References state. |
|
Reset the decoder. This will clear the internal state (carry) so that new independent data can be decoded. Definition at line 157 of file base64.h. References state. |
|
Current decode state (carry).
Definition at line 137 of file base64.h. Referenced by Base64Decoder(), decode(), operator=(), and reset(). |