Foxit PDF SDK

Public Member Functions | List of all members
CFX_ArchiveSaver Class Reference
FXCRT

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_ArchiveSaver & | operator<< (const CFX_ByteString &bstr)
| Left shifts(<<) operator overload. Serialize a byte string. More...
CFX_ArchiveSaver & | operator<< (const CFX_WideString &wstr)
| Left shifts(<<) operator overload. Serialize a wide string. More...
CFX_ArchiveSaver & | operator<< (double i)
| Left shifts(<<) operator overload. Serialize a double value. More...
CFX_ArchiveSaver & | operator<< (FX_BOOL i)
| Left shifts(<<) operator overload. Serialize a bool. More...
CFX_ArchiveSaver & | operator<< (FX_BSTR bstr)
| Left shifts(<<) operator overload. Serialize a non-buffered byte string. More...
CFX_ArchiveSaver & | operator<< (FX_BYTE i)
| Left shifts(<<) operator overload. Serialize a single byte. More...
CFX_ArchiveSaver & | operator<< (FX_DWORD i)
| Left shifts(<<) operator overload. Serialize a FX_DWORD value. More...
CFX_ArchiveSaver & | operator<< (FX_FLOAT i)
| Left shifts(<<) operator overload. Serialize a floating-point. More...
CFX_ArchiveSaver & | operator<< (FX_INT64 i)
| Left shifts(<<) operator overload. Serialize a FX_INT64 value. More...
CFX_ArchiveSaver & | operator<< (FX_LPCSTR bstr)
| Left shifts(<<) operator overload. Serialize a zero-terminated string. More...
CFX_ArchiveSaver & | operator<< (FX_LPCWSTR bstr)
| Left shifts(<<) operator overload. Serialize a zero-terminated wide character string. More...
CFX_ArchiveSaver & | operator<< (int i)
| Left shifts(<<) operator overload. Serialize a integer. 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] | pAllocator | Allocator 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<< | ( | const CFX_ByteString & | bstr | ) |

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

Parameters

  [in] | bstr | The input byte string.

Returns
  A reference to the archive saver.

## ◆ operator<<() [2/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] | wstr | The input wide string.

Returns
  A reference to the archive saver.

## ◆ operator<<() [3/12]

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

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

Parameters

  [in] | i | The input double value.

Returns
  A reference to the archive saver.

## ◆ operator<<() [4/12]

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

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

Parameters

  [in] | i | The input bool.

Returns
  A reference to the archive saver.

## ◆ operator<<() [5/12]

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

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

Parameters

  [in] | bstr | The input non-buffered byte string.

Returns
  A reference to the archive saver.

## ◆ operator<<() [6/12]

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

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

Parameters

  [in] | i | The input byte.

Returns
  A reference to the archive saver.

## ◆ operator<<() [7/12]

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

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

Parameters

  [in] | i | The input FX_DWORD value.

Returns
  A reference to the archive saver.

## ◆ operator<<() [8/12]

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

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

Parameters

  [in] | i | The input floating-point.

Returns
  A reference to the archive saver.

## ◆ operator<<() [9/12]

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

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

Parameters

  [in] | i | The input FX_INT64 value.

Returns
  A reference to the archive saver.

## ◆ operator<<() [10/12]

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

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

Parameters

  [in] | bstr | The input 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] | bstr | The input zero-terminated wide character string.

Returns
  A reference to the archive saver.

## ◆ operator<<() [12/12]

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

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

Parameters

  [in] | i | The input integer.

Returns
  A reference to the archive saver.

## ◆ SetStream()

void CFX_ArchiveSaver::SetStream | ( | IFX_FileStream * | pStream | ) |
| inline

Set the attached stream.

Parameters

  [in] | pStream | The stream to the saved data.

Returns
  None.

## ◆ Write()

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

Serialize a memory block.

Parameters

  [in] | pData | The pointer to a memory block.
  [in] | dwSize | The size in bytes of the memory block.

Returns
  None.