CppCMS
Public Types | Public Member Functions | List of all members
cppcms::archive Class Reference

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 &)
 

Detailed Description

Class that represents a binary archive that can be stored in persistent storage or transfered.

Member Enumeration Documentation

Operations mode on archive

Constructor & Destructor Documentation

cppcms::archive::archive ( )

Create new archive, by default in save_to_archive mode

cppcms::archive::~archive ( )

Destructor

cppcms::archive::archive ( archive const &  )

Copy archive (avoid it)

Member Function Documentation

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&().

mode_type cppcms::archive::mode ( )

Get IO mode

size_t cppcms::archive::next_chunk_size ( )

Get the size of the next chunk that can be read

archive const& cppcms::archive::operator= ( archive const &  )

Assign archive (avoid it)

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


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