Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cArchive Class Reference

#include <cArchive.h>

Public Member Functions

 cArchive (cStreamOutput &so) noexcept
 
 cArchive (cStreamInput &si) noexcept
 
 cArchive (cStream &s, bool bStoring) noexcept
 
bool IsStoring () const noexcept
 
bool IsLoading () const noexcept
 
cStreamOutputref_Out ()
 
cStreamInputref_Inp ()
 
HRESULT Serialize (void *pData, size_t nSize)
 Serialize Base Types. More...
 
HRESULT SerializeSize (size_t &nSize)
 
HRESULT Write (const void *pData, size_t nSize)
 
HRESULT Read (void *pData, size_t nSize)
 
COUNT_t ReadCount ()
 
void WriteCount (size_t n)
 

Friends

class cArchiveTests
 

Detailed Description

Form a bidirectional (typeless) binary stream of serialized data.

Note
this is inherently dangerous to use since it contains no default/automatic typing/versioning information.
put cVariant into the archive if you desire typing information. (and some version change resistance) This is extensible to any type. Similar to the MFC CArchive type. except << >> are overridden by the type of the Archive (store vs retrieve). i.e. store and retrieve a particular structure can use the same code.

Constructor & Destructor Documentation

◆ cArchive() [1/3]

Gray::cArchive::cArchive ( cStreamOutput so)
inlinenoexcept

◆ cArchive() [2/3]

Gray::cArchive::cArchive ( cStreamInput si)
inlinenoexcept

◆ cArchive() [3/3]

Gray::cArchive::cArchive ( cStream s,
bool  bStoring 
)
inlinenoexcept

Member Function Documentation

◆ IsLoading()

bool Gray::cArchive::IsLoading ( ) const
inlinenoexcept

I am loading the object from the read archive cStreamInput. like MFC cArchive

◆ IsStoring()

bool Gray::cArchive::IsStoring ( ) const
inlinenoexcept

I am storing the object to the write archive cStreamOutput. like MFC cArchive

◆ Read()

HRESULT Gray::cArchive::Read ( void *  pData,
size_t  nSize 
)
inline

◆ ReadCount()

COUNT_t Gray::cArchive::ReadCount ( )
inline

◆ ref_Inp()

cStreamInput& Gray::cArchive::ref_Inp ( )
inline

◆ ref_Out()

cStreamOutput& Gray::cArchive::ref_Out ( )
inline

◆ Serialize()

HRESULT Gray::cArchive::Serialize ( void *  pData,
size_t  nSize 
)

Serialize Base Types.

Returns
<0 = error HRESULT_WIN32_C(ERROR_IO_INCOMPLETE)

◆ SerializeSize()

HRESULT Gray::cArchive::SerializeSize ( size_t &  nSize)

Write a compressed size. high bit of byte is reserved to say there is more to come. bytes stored low to high (of course) MFC calls this "Count"

◆ Write()

HRESULT Gray::cArchive::Write ( const void *  pData,
size_t  nSize 
)
inline

◆ WriteCount()

void Gray::cArchive::WriteCount ( size_t  n)
inline

Friends And Related Function Documentation

◆ cArchiveTests

friend class cArchiveTests
friend

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