Antkeeper
0.0.1
|
Deserialize context implementation using PhysicsFS. More...
#include <physfs-deserialize-context.hpp>
Public Member Functions | |
physfs_deserialize_context (const std::filesystem::path &path) noexcept(false) | |
Constructs a PhysicsFS deserialize context, opening a file using PhysicsFS and associating it with this deserialize context. More... | |
physfs_deserialize_context () noexcept=default | |
Constructs a PhysicsFS deserialize context. More... | |
virtual | ~physfs_deserialize_context () |
Destructs a PhysicsFS deserialize context, internally closing a file using PhysicsFS. More... | |
void | open (const std::filesystem::path &path) noexcept(false) |
Opens a file using PhysicsFS and associates it with the deserialize context. More... | |
void | close () noexcept |
Closes the associated file using PhysicsFS. More... | |
bool | is_open () const noexcept |
Returns true if the PhysicsFS file associated with this deserialize context is open, false otherwise. More... | |
const std::filesystem::path & | path () const noexcept override |
Returns the path associated with this deserialize context. More... | |
bool | error () const noexcept override |
Returns true if an error occured during a read operation or initialization, false otherwise. More... | |
bool | eof () const noexcept override |
Returns true if the end of a file was reached. More... | |
std::size_t | size () const noexcept override |
Returns the size of the file, in bytes. More... | |
std::size_t | tell () const override |
Returns the offsets from the start of the file to the current position, in bytes. More... | |
void | seek (std::size_t offset) override |
Seeks to a position in the file. More... | |
std::size_t | read8 (std::byte *data, std::size_t count) noexcept(false) override |
Reads 8-bit (byte) data. More... | |
std::size_t | read16_le (std::byte *data, std::size_t count) noexcept(false) override |
Reads 16-bit (word) little-endian data. More... | |
std::size_t | read16_be (std::byte *data, std::size_t count) noexcept(false) override |
Reads 16-bit (word) big-endian data. More... | |
std::size_t | read32_le (std::byte *data, std::size_t count) noexcept(false) override |
Reads 32-bit (double word) little-endian data. More... | |
std::size_t | read32_be (std::byte *data, std::size_t count) noexcept(false) override |
Reads 32-bit (double word) big-endian data. More... | |
std::size_t | read64_le (std::byte *data, std::size_t count) noexcept(false) override |
Reads 64-bit (quad word) little-endian data. More... | |
std::size_t | read64_be (std::byte *data, std::size_t count) noexcept(false) override |
Reads 64-bit (quad word) big-endian data. More... | |
![]() | |
template<std::endian Endian> | |
std::size_t | read16 (std::byte *data, std::size_t count) noexcept(false) |
Reads 16-bit (word) data. More... | |
template<std::endian Endian> | |
std::size_t | read32 (std::byte *data, std::size_t count) noexcept(false) |
Reads 32-bit (double word) data. More... | |
template<std::endian Endian> | |
std::size_t | read64 (std::byte *data, std::size_t count) noexcept(false) |
Reads 64-bit (quad word) data. More... | |
Deserialize context implementation using PhysicsFS.
Definition at line 30 of file physfs-deserialize-context.hpp.
|
explicitnoexcept |
Constructs a PhysicsFS deserialize context, opening a file using PhysicsFS and associating it with this deserialize context.
path | Path to a file to open. |
deserialize_error | File open error. |
Definition at line 23 of file physfs-deserialize-context.cpp.
|
defaultnoexcept |
Constructs a PhysicsFS deserialize context.
|
virtual |
Destructs a PhysicsFS deserialize context, internally closing a file using PhysicsFS.
Definition at line 40 of file physfs-deserialize-context.cpp.
|
noexcept |
Closes the associated file using PhysicsFS.
Definition at line 71 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Returns true
if the end of a file was reached.
Implements deserialize_context.
Definition at line 97 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Returns true
if an error occured during a read operation or initialization, false
otherwise.
Implements deserialize_context.
Definition at line 92 of file physfs-deserialize-context.cpp.
|
noexcept |
Returns true
if the PhysicsFS file associated with this deserialize context is open, false
otherwise.
Definition at line 82 of file physfs-deserialize-context.cpp.
|
noexcept |
Opens a file using PhysicsFS and associates it with the deserialize context.
path | Path to a file to open. |
deserialize_error | File open error. |
Definition at line 48 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Returns the path associated with this deserialize context.
Implements deserialize_context.
Definition at line 87 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Reads 16-bit (word) big-endian data.
[out] | data | Pointer to data destination. |
[in] | count | Number of words to read. |
deserialize_error | Read error. |
Implements deserialize_context.
Definition at line 177 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Reads 16-bit (word) little-endian data.
[out] | data | Pointer to data destination. |
[in] | count | Number of words to read. |
deserialize_error | Read error. |
Implements deserialize_context.
Definition at line 158 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Reads 32-bit (double word) big-endian data.
[out] | data | Pointer to data destination. |
[in] | count | Number of double words to read. |
deserialize_error | Read error. |
Implements deserialize_context.
Definition at line 215 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Reads 32-bit (double word) little-endian data.
[out] | data | Pointer to data destination. |
[in] | count | Number of double words to read. |
deserialize_error | Read error. |
Implements deserialize_context.
Definition at line 196 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Reads 64-bit (quad word) big-endian data.
[out] | data | Pointer to data destination. |
[in] | count | Number of quad words to read. |
deserialize_error | Read error. |
Implements deserialize_context.
Definition at line 253 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Reads 64-bit (quad word) little-endian data.
[out] | data | Pointer to data destination. |
[in] | count | Number of quad words to read. |
deserialize_error | Read error. |
Implements deserialize_context.
Definition at line 234 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Reads 8-bit (byte) data.
[out] | data | Pointer to data destination. |
[in] | count | Number of bytes to read. |
deserialize_error | Read error. |
Implements deserialize_context.
Definition at line 136 of file physfs-deserialize-context.cpp.
|
overridevirtual |
Seeks to a position in the file.
offset | Offset from the start of the file, in bytes. |
deserialize_error | Seek error. |
Implements deserialize_context.
Definition at line 125 of file physfs-deserialize-context.cpp.
|
overridevirtualnoexcept |
Returns the size of the file, in bytes.
Implements deserialize_context.
Definition at line 102 of file physfs-deserialize-context.cpp.
|
overridevirtual |
Returns the offsets from the start of the file to the current position, in bytes.
deserialize_error | Tell error. |
Implements deserialize_context.
Definition at line 113 of file physfs-deserialize-context.cpp.