Hall-D Software
alpha
|
Base64 decode stream class. More...
#include <base64.h>
Public Member Functions | |
istreambuf (std::streambuf *sb, unsigned int width=76, char delimiter='\n') | |
construct using a streambuf More... | |
~istreambuf () | |
closes the base64 stream More... | |
Private Member Functions | |
int | underflow () |
requests that input buffer be reloaded (overloaded from streambuf) More... | |
Private Attributes | |
std::streambuf * | _sb |
bool | end |
char | delim |
unsigned int | delim_w |
unsigned int | col |
char | buf [3] |
Base64 decode stream class.
decodes data encoded in base64 and makes it available for reading. Only 4 bytes buffered at a time, and this is not configurable
xstream::base64::istreambuf::istreambuf | ( | std::streambuf * | sb, |
unsigned int | width = 76 , |
||
char | delimiter = '\n' |
||
) |
construct using a streambuf
sb | streambuf where to read the encoded data from |
width | width in bytes of lines (=0 for unlimited lines) |
delimiter | char to delimit the lines |
the parameters need to be the same specified at encoding or it will throw an exception indicating invalid data width=76
and delim=newline
are default because they are the values in the RFC
if data is not delimited exactly at width
characters with a newline, decoding will throw an exception. RFC specifies that whitespace should be ignored but this library is very strict when decoding, interpreting spurious whitespace as an error.
Definition at line 186 of file base64.cpp.
xstream::base64::istreambuf::~istreambuf | ( | ) |
|
private |
requests that input buffer be reloaded (overloaded from streambuf)
Definition at line 192 of file base64.cpp.
References _sb, buf, col, xstream::base64::decode(), delim, delim_w, end, xstream::base64::eof, and LOG.
|
private |
|
private |
buffer to store decoded data
Definition at line 113 of file base64.h.
Referenced by istreambuf(), and underflow().
|
private |
Definition at line 112 of file base64.h.
Referenced by underflow().
|
private |
Definition at line 110 of file base64.h.
Referenced by underflow().
|
private |
Definition at line 111 of file base64.h.
Referenced by underflow().
|
private |
signals if stream has reached the end
Definition at line 109 of file base64.h.
Referenced by underflow().