|
Rebel Fork Framework
|
Archive implementation helper. Provides default Archive implementation for most cases. More...
#include <Urho3D/IO/ArchiveBase.h>
Public Member Functions | |
Archive implementation | |
| Context * | GetContext () final |
| Get context. | |
| ea::string_view | GetName () const override |
| Return name of the archive if applicable. | |
| unsigned | GetChecksum () override |
| Return a checksum if applicable. | |
| bool | IsEOF () const final |
| Whether the archive can no longer be serialized. | |
| void | Flush () final |
| Flush all pending events. Should be called at least once before destructor. | |
| unsigned | SerializeVersion (unsigned version) final |
| Serialize version number. 0 is invalid version. | |
Common exception factories | |
| ArchiveException | IOFailureException (ea::string_view elementName) const |
| ArchiveException | DuplicateElementException (ea::string_view elementName) const |
| ArchiveException | ElementNotFoundException (ea::string_view elementName) const |
| ArchiveException | ElementNotFoundException (ea::string_view elementName, unsigned elementIndex) const |
| ArchiveException | UnexpectedElementValueException (ea::string_view elementName) const |
| ArchiveException | UnexpectedEOFException (ea::string_view elementName) const |
Public Member Functions inherited from Urho3D::Archive | |
| virtual bool | IsInput () const =0 |
| virtual bool | IsHumanReadable () const =0 |
| virtual bool | IsUnorderedAccessSupportedInCurrentBlock () const =0 |
| virtual bool | HasElementOrBlock (const char *name) const =0 |
| 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. | |
| ArchiveBlock | OpenBlock (const char *name, unsigned sizeHint, bool safe, ArchiveBlockType type) |
| 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. | |
| ArchiveBlock | OpenSequentialBlock (const char *name) |
| Open Sequential block. Will be automatically closed when returned object is destroyed. | |
| 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. | |
Protected Member Functions | |
| ArchiveBase (Context *context) | |
| void | SetDelayedException (std::exception_ptr ptr) |
| void | FlushDelayedException () |
| void | CheckIfNotEOF (ea::string_view elementName) const |
| void | CheckBlockOrElementName (ea::string_view elementName) const |
| void | CloseArchive () |
| void | ReadBytesFromHexString (ea::string_view elementName, const ea::string &string, void *bytes, unsigned size) |
Protected Member Functions inherited from Urho3D::MovableNonCopyable | |
| MovableNonCopyable (MovableNonCopyable &&other)=default | |
| MovableNonCopyable & | operator= (MovableNonCopyable &&other)=default |
| MovableNonCopyable (const MovableNonCopyable &other)=delete | |
| MovableNonCopyable & | operator= (const MovableNonCopyable &other)=delete |
Static Protected Attributes | |
| static constexpr const char * | rootBlockName = "Root" |
| static constexpr const char * | versionElementName = "Version" |
Private Attributes | |
| Context * | context_ {} |
| std::exception_ptr | delayedException_ |
| bool | eof_ {} |
Additional Inherited Members | |
Static Public Member Functions inherited from Urho3D::Archive | |
| static bool | ValidateName (ea::string_view name) |
| Validate element or block name. | |
|
inlinefinalvirtual |
Flush all pending events. Should be called at least once before destructor.
Implements Urho3D::Archive.
|
inlineoverridevirtual |
Return a checksum if applicable.
Implements Urho3D::Archive.
Reimplemented in Urho3D::BinaryOutputArchive, and Urho3D::BinaryInputArchive.
|
inlinefinalvirtual |
Get context.
Implements Urho3D::Archive.
|
inlineoverridevirtual |
Return name of the archive if applicable.
Implements Urho3D::Archive.
Reimplemented in Urho3D::JSONArchiveBase< BlockType, IsInputBool >, Urho3D::JSONArchiveBase< JSONInputArchiveBlock, true >, Urho3D::JSONArchiveBase< JSONOutputArchiveBlock, false >, Urho3D::XMLArchiveBase< BlockType, IsInputBool >, Urho3D::XMLArchiveBase< XMLInputArchiveBlock, true >, Urho3D::XMLArchiveBase< XMLOutputArchiveBlock, false >, Urho3D::BinaryOutputArchive, and Urho3D::BinaryInputArchive.
|
inlinefinalvirtual |
Whether the archive can no longer be serialized.
Implements Urho3D::Archive.
|
inlinefinalvirtual |
Serialize version number. 0 is invalid version.
Implements Urho3D::Archive.