Rebel Fork Framework
|
#include <Urho3D/IO/Archive.h>
Public Member Functions | |
virtual Context * | GetContext ()=0 |
Get context. | |
virtual ea::string_view | GetName () const =0 |
Return name of the archive if applicable. | |
virtual unsigned | GetChecksum ()=0 |
Return a checksum if applicable. | |
virtual bool | IsInput () const =0 |
virtual bool | IsHumanReadable () const =0 |
virtual bool | IsUnorderedAccessSupportedInCurrentBlock () const =0 |
virtual bool | HasElementOrBlock (const char *name) const =0 |
virtual bool | IsEOF () const =0 |
Whether the archive can no longer be serialized. | |
virtual ea::string | GetCurrentBlockPath () const =0 |
Return current string stack. | |
virtual void | BeginBlock (const char *name, unsigned &sizeHint, bool safe, ArchiveBlockType type)=0 |
virtual void | EndBlock () noexcept=0 |
End archive block. May postpone ArchiveException until later. | |
virtual void | Flush ()=0 |
Flush all pending events. Should be called at least once before destructor. | |
ArchiveBlock | OpenBlock (const char *name, unsigned sizeHint, bool safe, ArchiveBlockType type) |
Serialize primitive element | |
virtual void | Serialize (const char *name, bool &value)=0 |
virtual void | Serialize (const char *name, signed char &value)=0 |
virtual void | Serialize (const char *name, unsigned char &value)=0 |
virtual void | Serialize (const char *name, short &value)=0 |
virtual void | Serialize (const char *name, unsigned short &value)=0 |
virtual void | Serialize (const char *name, int &value)=0 |
virtual void | Serialize (const char *name, unsigned int &value)=0 |
virtual void | Serialize (const char *name, long long &value)=0 |
virtual void | Serialize (const char *name, unsigned long long &value)=0 |
virtual void | Serialize (const char *name, float &value)=0 |
virtual void | Serialize (const char *name, double &value)=0 |
virtual void | Serialize (const char *name, ea::string &value)=0 |
virtual void | SerializeBytes (const char *name, void *bytes, unsigned size)=0 |
Serialize bytes. Size is not encoded and should be provided externally! | |
virtual void | SerializeVLE (const char *name, unsigned &value)=0 |
Serialize Variable Length Encoded unsigned integer, up to 29 significant bits. | |
virtual unsigned | SerializeVersion (unsigned version)=0 |
Serialize version number. 0 is invalid version. | |
ArchiveBlock | OpenSequentialBlock (const char *name) |
Open Sequential block. Will be automatically closed when returned object is destroyed. More... | |
ArchiveBlock | OpenUnorderedBlock (const char *name) |
Open Unordered block. Will be automatically closed when returned object is destroyed. | |
ArchiveBlock | OpenArrayBlock (const char *name, unsigned sizeHint=0) |
Open Array block. Will be automatically closed when returned object is destroyed. | |
ArchiveBlock | OpenSafeSequentialBlock (const char *name) |
Open safe Sequential block. Will be automatically closed when returned object is destroyed. | |
ArchiveBlock | OpenSafeUnorderedBlock (const char *name) |
Open safe Unordered block. Will be automatically closed when returned object is destroyed. | |
Static Public Member Functions | |
static bool | ValidateName (ea::string_view name) |
Validate element or block name. | |
Archive interface.
|
pure virtual |
Begin archive block. Size is required for Array blocks. It is guaranteed that errors occurred during serialization of the safe block don't affect data outside of the block.
Implemented in Urho3D::XMLInputArchive, Urho3D::JSONInputArchive, Urho3D::BinaryInputArchive, Urho3D::XMLOutputArchive, Urho3D::JSONOutputArchive, and Urho3D::BinaryOutputArchive.
|
pure virtual |
Return whether the element or block with given name is present. Should be called only if both IsInput and IsUnorderedAccessSupportedInCurrentBlock are true.
Implemented in Urho3D::ArchiveBaseT< BlockType, IsInputBool, IsHumanReadableBool >, Urho3D::ArchiveBaseT< BinaryInputArchiveBlock, IsInputBool, false >, Urho3D::ArchiveBaseT< XMLInputArchiveBlock, IsInputBool, true >, Urho3D::ArchiveBaseT< XMLOutputArchiveBlock, IsInputBool, true >, Urho3D::ArchiveBaseT< JSONOutputArchiveBlock, IsInputBool, true >, Urho3D::ArchiveBaseT< BlockType, IsInputBool, false >, Urho3D::ArchiveBaseT< JSONInputArchiveBlock, IsInputBool, true >, Urho3D::ArchiveBaseT< BlockType, IsInputBool, true >, and Urho3D::ArchiveBaseT< BinaryOutputArchiveBlock, IsInputBool, false >.
|
pure virtual |
Whether the human-readability is preferred over performance and output size.
Implemented in Urho3D::ArchiveBaseT< BlockType, IsInputBool, IsHumanReadableBool >.
|
pure virtual |
Whether the archive is in input mode. It is guaranteed that input archive doesn't read from any variable. It is guaranteed that output archive doesn't write to any variable. It is save to cast away const-ness when serializing into output archive.
Implemented in Urho3D::ArchiveBaseT< BlockType, IsInputBool, IsHumanReadableBool >.
|
pure virtual |
Return whether the unordered element access is supported in currently open block. Always false if current block is not Unordered. Always false for some archive types.
Implemented in Urho3D::ArchiveBaseT< BlockType, IsInputBool, IsHumanReadableBool >.
|
inline |
Do BeginBlock and return the guard that will call EndBlock automatically on destruction. Return null block in case of error.
|
inline |
Open Sequential block. Will be automatically closed when returned object is destroyed.
Open block helpers