by Kyle J Burgess
(github.com/kyy13)
pod-io is a key-value pair binary serialization library.
It has options for various checksum types, compression levels (using DEFLATE compression), and the data is recoverable independent of system endianness.
Compatible with c
, c++
and c#
.
details
- Stores key-value pairs where the key is an ASCII string, and the value is an array the following:
- 8-bit ASCII characters, or UTF8 characters
- 8-bit, 16-bit, 32-bit, or 64-bit unsigned integers
- 8-bit, 16-bit, 32-bit, or 64-bit twos-complement signed integers
- 32-bit, or 64-bit IEEE floating point numbers
- Individual array size is limited to 2^32 bytes
- Note that any 8-bit data can be stored in any 8-bit type, because there is no endianness for 8-bit values. The differentiation between 8-bit types is just for type hinting.
- Files keep track of the endianness they were saved in--allowing for optimal performance when writing and reading from a host with the same endianness.
- When a file is loaded into memory, the POD values are converted into the correct endianness for the host.
- Supports
adler32
, andcrc32
checksum. - pod-io validates checksums on load.
- Compression levels are 0-9, the same as
zlib
's DEFLATE compression levels.
details
- Download the latest release from the releases page.
- Drop the DLL into the root directory of your build folder.
- If using
c#
, see the wrappers folder for the dll import wrapper.
details
- There are precompiled binaries available on the releases page.
- See the build scripts in the scripts folder for examples on how to build with cmake.
The scripts are setup to targetmingw-w64
for64-bit windows
.
- A working
c++17
(or higher) compiler. CMake
version 3.7 or higher
- Clone the repository with
git clone --recurse-submodules https://github.com/kyy13/pod-io
- Run
cmake
withDCMAKE_BUILD_TYPE=Release
to generate the build files - Run
make
to build
details
All character types are stored in ASCII where the smallest byte corresponds to the left-most character.
byte(s) | value(s) |
---|---|
0...3 |
signaturePODX |
4...7 |
endiannessLITE little endianBIGE big endian |
8...11 |
checksumNONE no checksumAD32 adler32 CR32 crc32 |
12...15 |
reservedNONE |
byte(s) | value(s) |
---|---|
16...N |
DEFLATE compressed bytes of a contiguous array of data blocks. See BLOCK |
byte(s) | value(s) |
---|---|
None orN+1...N+4 |
If checksum is NONE , then the trailer checksum must be 0 bytes.If checksum is AD32 or CR32 , then 4 bytes of 32-bit unsigned integer checksum stored in the endian order specified by endianness. The checksum is computed for the entire file except the TRAILER starting at a configurable value. |
byte(s) | value(s) |
---|---|
0...3 |
key size 32-bit unsigned integer stored in the endian order specified by endianness. Represents the number of characters in the key. |
4...7 |
data size 32-bit unsigned integer stored in the endian order specified by endianness. Represents the number of values in data. NOTE: This represents the number of values not the number of bytes. |
8...11 |
data type 32-bit unsigned integer stored in the endian order specified by endianness 0x02000001 8-bit ASCII character0x03000001 8-bit UTF8 character0x00000001 8-bit unsigned integer0x00000002 16-bit unsigned integer0x00000004 32-bit unsigned integer0x00000008 64-bit unsigned integer0x00010001 8-bit twos-complement signed integer0x00010002 16-bit twos-complement signed integer0x00010004 32-bit twos-complement signed integer0x00010008 64-bit twos-complement signed integer0x01010004 32-bit IEEE floating point number0x01010008 64-bit IEEE floating point number |
12...X |
key encoded as key size number of 8-bit ASCII characters. |
X+1...Y |
data encoded as data size number of values stored contiguously in an array where each value is stored in the endian order specified by endianness. |
pod-io uses zlib [1] for data compression and decompression.