PByteStream.h
Go to the documentation of this file.
233 PResult WriteBytes(const PByteArray& sourceArray, papillon::uint64 sourcePosition, papillon::uint64 numBytes = 0);
271 template <> inline PResult PByteStream::ReadObject(bool& value) { return ReadBytesWithoutChecks(&value, sizeof(int8 )); }
272 template <> inline PResult PByteStream::ReadObject(papillon::int8& value) { return ReadBytesWithoutChecks(&value, sizeof(int8 )); }
273 template <> inline PResult PByteStream::ReadObject(papillon::int16& value) { return ReadBytesWithoutChecks(&value, sizeof(int16 )); }
274 template <> inline PResult PByteStream::ReadObject(papillon::int32& value) { return ReadBytesWithoutChecks(&value, sizeof(int32 )); }
275 template <> inline PResult PByteStream::ReadObject(papillon::int64& value) { return ReadBytesWithoutChecks(&value, sizeof(int64 )); }
276 template <> inline PResult PByteStream::ReadObject(papillon::uint8& value) { return ReadBytesWithoutChecks(&value, sizeof(uint8 )); }
277 template <> inline PResult PByteStream::ReadObject(papillon::uint16& value) { return ReadBytesWithoutChecks(&value, sizeof(uint16)); }
278 template <> inline PResult PByteStream::ReadObject(papillon::uint32& value) { return ReadBytesWithoutChecks(&value, sizeof(uint32)); }
279 template <> inline PResult PByteStream::ReadObject(papillon::uint64& value) { return ReadBytesWithoutChecks(&value, sizeof(uint64)); }
280 template <> inline PResult PByteStream::ReadObject(float& value) { return ReadBytesWithoutChecks(&value, sizeof(float )); }
281 template <> inline PResult PByteStream::ReadObject(double& value) { return ReadBytesWithoutChecks(&value, sizeof(double)); }
283 template <> inline PResult PByteStream::WriteObject(const bool& value) { return WriteBytes(&value, sizeof(bool )); }
284 template <> inline PResult PByteStream::WriteObject(const papillon::int8& value) { return WriteBytes(&value, sizeof(int8 )); }
285 template <> inline PResult PByteStream::WriteObject(const papillon::int16& value) { return WriteBytes(&value, sizeof(int16 )); }
286 template <> inline PResult PByteStream::WriteObject(const papillon::int32& value) { return WriteBytes(&value, sizeof(int32 )); }
287 template <> inline PResult PByteStream::WriteObject(const papillon::int64& value) { return WriteBytes(&value, sizeof(int64 )); }
288 template <> inline PResult PByteStream::WriteObject(const papillon::uint8& value) { return WriteBytes(&value, sizeof(uint8 )); }
289 template <> inline PResult PByteStream::WriteObject(const papillon::uint16& value){ return WriteBytes(&value, sizeof(uint16)); }
290 template <> inline PResult PByteStream::WriteObject(const papillon::uint32& value){ return WriteBytes(&value, sizeof(uint32)); }
291 template <> inline PResult PByteStream::WriteObject(const papillon::uint64& value){ return WriteBytes(&value, sizeof(uint64)); }
292 template <> inline PResult PByteStream::WriteObject(const float& value) { return WriteBytes(&value, sizeof(float )); }
293 template <> inline PResult PByteStream::WriteObject(const double& value) { return WriteBytes(&value, sizeof(double)); }
PResult Read(PByteStream &is, papillon::ESerialisationFormat format=papillon::E_BINARY_FORMAT)
Reads this object from the bytes stream retrieved from the specified input stream (deserialisation)...
PResult Write(PByteStream &os, ESerialisationFormat format=papillon::E_BINARY_FORMAT) const
Writes this object to the specified output stream (serialisation).
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
PObject ReadObject(PByteStream &is, PResult &result) const
Builds a PObject from a byte stream (deserialisation).
PResult ReadObject(T &t)
Deserialises the specified object from this stream.
Definition: PByteStream.h:189
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PByteStream class is a generic byte stream (can be a memory stream or a file stream).
Definition: PByteStream.h:69
PResult WriteObject(const T &t)
Serialises the specified object to this stream.
Definition: PByteStream.h:244
Class PResult: a result returned by most of Papillon functions; this class is used to replace classic...
Class PObject: the root class of all Papillon classes.
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45
PByteStream & operator<<(const T &t)
Serialises the specified object to this stream; throw an exception if failure.
Definition: PByteStream.h:258
PByteStream & operator>>(T &t)
Deserialises the specified object from this stream.
Definition: PByteStream.h:203