CppCMS
|
Class that represents a binary archive that can be stored in persistent storage or transfered. More...
#include <cppcms/serialization_classes.h>
Public Types | |
enum | mode_type { save_to_archive, load_from_archive } |
Public Member Functions | |
void | reserve (size_t size) |
void | write_chunk (void const *begin, size_t len) |
void | read_chunk (void *begin, size_t len) |
size_t | next_chunk_size () |
bool | eof () |
std::string | read_chunk_as_string () |
void | mode (mode_type m) |
mode_type | mode () |
void | reset () |
std::string | str () |
void | str (std::string const &str) |
archive () | |
~archive () | |
archive (archive const &) | |
archive const & | operator= (archive const &) |
Class that represents a binary archive that can be stored in persistent storage or transfered.
Operations mode on archive
Create new archive, by default in save_to_archive mode
Destructor
cppcms::archive::archive | ( | archive const & | ) |
Copy archive (avoid it)
bool cppcms::archive::eof | ( | ) |
Get if we got to the end of archive while reading
void cppcms::archive::mode | ( | mode_type | m | ) |
Set IO mode, resets pointer
Referenced by cppcms::operator&().
Get IO mode
size_t cppcms::archive::next_chunk_size | ( | ) |
Get the size of the next chunk that can be read
void cppcms::archive::read_chunk | ( | void * | begin, |
size_t | len | ||
) |
Read a chunk of size len from archive
std::string cppcms::archive::read_chunk_as_string | ( | ) |
Read next chunk as std::string
void cppcms::archive::reserve | ( | size_t | size | ) |
Reserve some memory before we write actual data
void cppcms::archive::reset | ( | ) |
Reset IO pointer
std::string cppcms::archive::str | ( | ) |
Get serialized object memory
void cppcms::archive::str | ( | std::string const & | str | ) |
Set serialized object memory, sets mode to load_from_archive
void cppcms::archive::write_chunk | ( | void const * | begin, |
size_t | len | ||
) |
Write a chunk of size len to archive