Archive
an abstraction for the class archive
Archive provides the abstraction for storage during the serialization process.
Hierarchy
precache::util::Archive
Constructor
Archive( const PCSmallString& rkstrFileName, bool bOpenForRead) throw(precache::util::SerializationException)
Opens a class archive for reading or writting.
- rkstrFileName
- the name of the file storing the archive
Methods
ReadBuf
void ReadBuf( void *buf, int cBufSize) throw (precache::util::SerializationException)
Reads cBufSize bytes of memory in the archive.
- buf
- a pointer to a memory buffer containing the data to be stored
- cBufSize
- the number of bytes to be read
- throws
- ReadBuf throws a SerializationException if the archive encounters an error while storing the data.
WriteBuf
void WriteBuf( const void *buf, int cBufSize) throw (precache::util::SerializationException)
Stores cBufSize bytes of memory in the archive.
- buf
- a pointer to a memory buffer containing the data to be stored
- cBufSize
- the number of bytes to be stored
- throws
- WriteBuf throws a SerializationException if the archive encounters an error while storing the data.
Read operators
Archive& operator>>( TypeName &val) throw (SerializationException)
Archive prodives a number of read operators for accessing archived data:
Archive& operator>>( precache::util::Serializable* &objVal) throw (precache::util::SerializationException)
Archive& operator>>( precache::util::Serializable &objVal) throw (precache::util::SerializationException)
Archive& operator>>( PCSmallString& rstrVal) throw (precache::util::SerializationException)
Archive& operator>>( PC_STRING &szVal) throw (precache::util::SerializationException)
template<class KeyType, class ElementType> Archive& operator>>( map<KeyType, ElementType> &rmpVal) throw (precache::util::SerializationException)
template<class ElementType> Archive& operator>>( set<ElementType> &rmpVal) throw (precache::util::SerializationException)
Archive& operator>>( PC_CHAR &val) throw (SerializationException)
Archive& operator>>( PC_UCHAR &val) throw (SerializationException)
Archive& operator>>(PC_SHORT &val) throw (SerializationException)
Archive& operator>>( PC_USHORT &val) throw (SerializationException)
Archive& operator>>( PC_INT &val) throw (SerializationException)
Archive& operator>>( PC_UINT &val) throw (SerializationException)
Archive& operator>>( PC_LONG &val) throw (SerializationException)
Archive& operator>>( PC_ULONG &val) throw (SerializationException)
Archive& operator>>( PC_DOUBLE &val) throw (SerializationException)
Archive& operator>>( PC_FLOAT &val) throw (SerializationException)
- val
- the value to be read
- returns
- a reference to the archive object
- throws
- Archive throws a SerializationException if the archive encounters an error while reading the data
Write operators
Archive& operator<<( const TypeName val) throw (SerializationException)
Archive prodives a number of write operators for storing archived data:
Archive& operator<<( precache::util::Serializable *&objVal) throw (precache::util::SerializationException)
Archive& operator<<( precache::util::Serializable &objVal) throw (precache::util::SerializationException)
Archive& operator<<( const PCSmallString& rkstrVal)
Archive& operator<<( const PC_STRING kszVal)
template<class KeyType, class ElementType> Archive& operator<<( map<KeyType, ElementType> &rmpVal) throw (precache::util::SerializationException)
template<class ElementType> Archive& operator<<( Set<ElementType> &rmpVal) throw (precache::util::SerializationException)
Archive& operator<<( const PC_CHAR val) throw (SerializationException)
Archive& operator<<( const PC_UCHAR val) throw (SerializationException)
Archive& operator<<( const PC_SHORT val) throw (SerializationException)
Archive& operator<<( const PC_USHORT val) throw (SerializationException)
Archive& operator<<( const PC_INT val) throw (SerializationException)
Archive& operator<<( const PC_UINT val) throw (SerializationException)
Archive& operator<<( const PC_LONG val) throw (SerializationException)
Archive& operator<<( const PC_ULONG val) throw (SerializationException)
Archive& operator<<( const PC_DOUBLE val) throw (SerializationException)
Archive& operator<<( const PC_FLOAT val) throw (SerializationException)
- val
- the value to be written
- returns
- a reference to the archive object
- throws
- Archive throws a SerializationException if the archive encounters an error while reading the data
|