![]() |
Gamedev Framework (gf)
0.8.0
A C++14 framework for 2D games
|
A serializer to a binary file. More...
#include <gf/Serialization.h>
Public Member Functions | |
| Serializer (const Path &filename) | |
| Constructor. More... | |
| void | writeNil () |
| Write a null object. More... | |
| void | writeBoolean (bool data) |
| Write a boolean object. More... | |
| void | writeSigned (int64_t data) |
| Write a signed integer object. More... | |
| void | writeUnsigned (uint64_t data) |
| Write an unsigned object. More... | |
| void | writeFloat (float data) |
| Write a single precison float object. More... | |
| void | writeDouble (double data) |
| Write a double precison float object. More... | |
| void | writeString (const char *data, uint32_t size) |
| Write a string object. More... | |
| void | writeBinary (const uint8_t *data, uint32_t size) |
| Write a binary object. More... | |
| void | writeArrayHeader (uint32_t size) |
| Write an array header. More... | |
| void | writeMapHeader (uint32_t size) |
| Write a map header. More... | |
| void | writeExtension (int8_t type, const uint8_t *data, uint32_t size) |
| Write an extension object. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| Serializer & | operator| (Serializer &ar, SerialArrayHeader header) |
| Serialize an array header with its size. More... | |
| Serializer & | operator| (Serializer &ar, SerialMapHeader header) |
| Serialize a map header with its size. More... | |
| Serializer & | operator| (Serializer &ar, std::nullptr_t) |
| Serialize a null object. More... | |
| Serializer & | operator| (Serializer &ar, bool data) |
| Serialize a boolean object. More... | |
| Serializer & | operator| (Serializer &ar, uint8_t data) |
| Serialize an unsigned integer object. More... | |
| Serializer & | operator| (Serializer &ar, uint16_t data) |
| Serialize an unsigned integer object. More... | |
| Serializer & | operator| (Serializer &ar, uint32_t data) |
| Serialize an unsigned integer object. More... | |
| Serializer & | operator| (Serializer &ar, uint64_t data) |
| Serialize an unsigned integer object. More... | |
| Serializer & | operator| (Serializer &ar, int8_t data) |
| Serialize a signed integer object. More... | |
| Serializer & | operator| (Serializer &ar, int16_t data) |
| Serialize a signed integer object. More... | |
| Serializer & | operator| (Serializer &ar, int32_t data) |
| Serialize a signed integer object. More... | |
| Serializer & | operator| (Serializer &ar, int64_t data) |
| Serialize a signed integer object. More... | |
| Serializer & | operator| (Serializer &ar, float data) |
| Serialize a single precision float object. More... | |
| Serializer & | operator| (Serializer &ar, double data) |
| Serialize a double precision float object. More... | |
| Serializer & | operator| (Serializer &ar, const char *str) |
| Serialize a string object. More... | |
| Serializer & | operator| (Serializer &ar, const std::string &str) |
| Serialize a string object. More... | |
| template<std::size_t N> | |
| Serializer & | operator| (Serializer &ar, const uint8_t(&bin)[N]) |
| Serialize a binary object. More... | |
| Serializer & | operator| (Serializer &ar, const std::vector< uint8_t > &bin) |
| Serialize a binary object. More... | |
| template<std::size_t N> | |
| Serializer & | operator| (Serializer &ar, const std::array< uint8_t, N > &bin) |
| Serialize a binary object. More... | |
| template<typename T , std::size_t N> | |
| Serializer & | operator| (Serializer &ar, const T(&array)[N]) |
| Serialize an array object. More... | |
| template<typename T > | |
| Serializer & | operator| (Serializer &ar, const std::vector< T > &array) |
| Serialize an array object. More... | |
| template<typename T , std::size_t N> | |
| Serializer & | operator| (Serializer &ar, const std::array< T, N > &array) |
| Serialize an array object. More... | |
| template<typename K , typename V > | |
| Serializer & | operator| (Serializer &ar, const std::map< K, V > &map) |
| Serialize a map object. More... | |
| template<typename K , typename V > | |
| Serializer & | operator| (Serializer &ar, const std::unordered_map< K, V > &map) |
| Serialize a map object. More... | |
| Serializer & | operator| (Serializer &ar, const DataObject &object) |
| Serialize a data object. More... | |
A serializer to a binary file.
The format used to serialize is MessagePack.
You should not use the methods in this class. Prefer using and overloading operator |.
| gf::Serializer::Serializer | ( | const Path & | filename | ) |
Constructor.
| filename | The name of the binary file |
| void gf::Serializer::writeArrayHeader | ( | uint32_t | size | ) |
Write an array header.
| void gf::Serializer::writeBinary | ( | const uint8_t * | data, |
| uint32_t | size | ||
| ) |
Write a binary object.
| void gf::Serializer::writeBoolean | ( | bool | data | ) |
Write a boolean object.
| void gf::Serializer::writeDouble | ( | double | data | ) |
Write a double precison float object.
| void gf::Serializer::writeExtension | ( | int8_t | type, |
| const uint8_t * | data, | ||
| uint32_t | size | ||
| ) |
Write an extension object.
| void gf::Serializer::writeFloat | ( | float | data | ) |
Write a single precison float object.
| void gf::Serializer::writeMapHeader | ( | uint32_t | size | ) |
Write a map header.
| void gf::Serializer::writeNil | ( | ) |
Write a null object.
| void gf::Serializer::writeSigned | ( | int64_t | data | ) |
Write a signed integer object.
| void gf::Serializer::writeString | ( | const char * | data, |
| uint32_t | size | ||
| ) |
Write a string object.
| void gf::Serializer::writeUnsigned | ( | uint64_t | data | ) |
Write an unsigned object.
|
related |
Serialize an array header with its size.
|
related |
Serialize a null object.
|
related |
Serialize a boolean object.
|
related |
Serialize an unsigned integer object.
|
related |
Serialize an unsigned integer object.
|
related |
Serialize a map header with its size.
|
related |
Serialize an unsigned integer object.
|
related |
Serialize an unsigned integer object.
|
related |
Serialize a signed integer object.
|
related |
Serialize a signed integer object.
|
related |
Serialize a signed integer object.
|
related |
Serialize a signed integer object.
|
related |
Serialize a single precision float object.
|
related |
Serialize a double precision float object.
|
related |
Serialize a string object.
|
related |
Serialize a string object.
|
related |
Serialize a binary object.
|
related |
Serialize a binary object.
|
related |
Serialize a binary object.
|
related |
Serialize an array object.
|
related |
Serialize an array object.
|
related |
Serialize an array object.
|
related |
Serialize a map object.
|
related |
Serialize a map object.
|
related |
Serialize a data object.
1.8.13