Foxit PDF Conversion SDK
CFX_ArchiveSaver Class Reference

Inherits CFX_Object.

Public Member Functions

 CFX_ArchiveSaver (IFX_Allocator *pAllocator=0)
 Construct with allocator. More...
 
FX_LPCBYTE GetBuffer () const
 Get the constant byte pointer to the saved data. More...
 
FX_INTPTR GetLength () const
 Get the length of saved data. More...
 
CFX_ArchiveSaveroperator<< (FX_BYTE i)
 Left shifts(<<) operator overload. Serialize a single byte. More...
 
CFX_ArchiveSaveroperator<< (FX_BOOL i)
 Left shifts(<<) operator overload. Serialize a bool. More...
 
CFX_ArchiveSaveroperator<< (int i)
 Left shifts(<<) operator overload. Serialize a integer. More...
 
CFX_ArchiveSaveroperator<< (FX_DWORD i)
 Left shifts(<<) operator overload. Serialize a FX_DWORD value. More...
 
CFX_ArchiveSaveroperator<< (FX_INT64 i)
 Left shifts(<<) operator overload. Serialize a FX_INT64 value. More...
 
CFX_ArchiveSaveroperator<< (FX_FLOAT i)
 Left shifts(<<) operator overload. Serialize a floating-point. More...
 
CFX_ArchiveSaveroperator<< (double i)
 Left shifts(<<) operator overload. Serialize a double value. More...
 
CFX_ArchiveSaveroperator<< (FX_BSTR bstr)
 Left shifts(<<) operator overload. Serialize a non-buffered byte string. More...
 
CFX_ArchiveSaveroperator<< (FX_LPCSTR bstr)
 Left shifts(<<) operator overload. Serialize a zero-terminated string. More...
 
CFX_ArchiveSaveroperator<< (const CFX_ByteString &bstr)
 Left shifts(<<) operator overload. Serialize a byte string. More...
 
CFX_ArchiveSaveroperator<< (FX_LPCWSTR bstr)
 Left shifts(<<) operator overload. Serialize a zero-terminated wide character string. More...
 
CFX_ArchiveSaveroperator<< (const CFX_WideString &wstr)
 Left shifts(<<) operator overload. Serialize a wide string. More...
 
void SetStream (IFX_FileStream *pStream)
 Set the attached stream. More...
 
void Write (const void *pData, FX_STRSIZE dwSize)
 Serialize a memory block. More...
 

Detailed Description

Binary archive using memory based buffer or stream.

Providing cross-platform data serialization and de-serialization service. Data structure is NOT stored in the archive, so the de-serialization must use exactly same structure in when serialization.

Constructor & Destructor Documentation

◆ CFX_ArchiveSaver()

CFX_ArchiveSaver::CFX_ArchiveSaver ( IFX_Allocator pAllocator = 0)
inline

Construct with allocator.

Parameters
[in]pAllocatorAllocator used in this class. NULL to use default allocator. Default value: NULL.

Member Function Documentation

◆ GetBuffer()

FX_LPCBYTE CFX_ArchiveSaver::GetBuffer ( ) const
inline

Get the constant byte pointer to the saved data.

Returns
The constant byte pointer to the saved data.

◆ GetLength()

FX_INTPTR CFX_ArchiveSaver::GetLength ( ) const
inline

Get the length of saved data.

Returns
The length in bytes of the saved data.

◆ operator<<() [1/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( FX_BYTE  i)

Left shifts(<<) operator overload. Serialize a single byte.

Parameters
[in]iThe input byte.
Returns
A reference to the archive saver.

◆ operator<<() [2/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( FX_BOOL  i)

Left shifts(<<) operator overload. Serialize a bool.

Parameters
[in]iThe input bool.
Returns
A reference to the archive saver.

◆ operator<<() [3/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( int  i)

Left shifts(<<) operator overload. Serialize a integer.

Parameters
[in]iThe input integer.
Returns
A reference to the archive saver.

◆ operator<<() [4/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( FX_DWORD  i)

Left shifts(<<) operator overload. Serialize a FX_DWORD value.

Parameters
[in]iThe input FX_DWORD value.
Returns
A reference to the archive saver.

◆ operator<<() [5/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( FX_INT64  i)

Left shifts(<<) operator overload. Serialize a FX_INT64 value.

Parameters
[in]iThe input FX_INT64 value.
Returns
A reference to the archive saver.

◆ operator<<() [6/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( FX_FLOAT  i)

Left shifts(<<) operator overload. Serialize a floating-point.

Parameters
[in]iThe input floating-point.
Returns
A reference to the archive saver.

◆ operator<<() [7/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( double  i)

Left shifts(<<) operator overload. Serialize a double value.

Parameters
[in]iThe input double value.
Returns
A reference to the archive saver.

◆ operator<<() [8/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( FX_BSTR  bstr)

Left shifts(<<) operator overload. Serialize a non-buffered byte string.

Parameters
[in]bstrThe input non-buffered byte string.
Returns
A reference to the archive saver.

◆ operator<<() [9/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( FX_LPCSTR  bstr)

Left shifts(<<) operator overload. Serialize a zero-terminated string.

Parameters
[in]bstrThe input string.
Returns
A reference to the archive saver.

◆ operator<<() [10/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( const CFX_ByteString bstr)

Left shifts(<<) operator overload. Serialize a byte string.

Parameters
[in]bstrThe input byte string.
Returns
A reference to the archive saver.

◆ operator<<() [11/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( FX_LPCWSTR  bstr)

Left shifts(<<) operator overload. Serialize a zero-terminated wide character string.

Wide strings are stored in UTF-16LE encoding.

Parameters
[in]bstrThe input zero-terminated wide character string.
Returns
A reference to the archive saver.

◆ operator<<() [12/12]

CFX_ArchiveSaver& CFX_ArchiveSaver::operator<< ( const CFX_WideString wstr)

Left shifts(<<) operator overload. Serialize a wide string.

Wide strings are stored in UTF-16LE encoding.

Parameters
[in]wstrThe input wide string.
Returns
A reference to the archive saver.

◆ SetStream()

void CFX_ArchiveSaver::SetStream ( IFX_FileStream pStream)
inline

Set the attached stream.

Parameters
[in]pStreamThe stream to the saved data.
Returns
None.

◆ Write()

void CFX_ArchiveSaver::Write ( const void *  pData,
FX_STRSIZE  dwSize 
)

Serialize a memory block.

Parameters
[in]pDataThe pointer to a memory block.
[in]dwSizeThe size in bytes of the memory block.
Returns
None.