Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
serialization.h File Reference
#include "irrlichttypes.h"
#include "exceptions.h"
#include <iostream>
#include <string_view>
+ Include dependency graph for serialization.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SER_FMT_VER_INVALID   255
 
#define SER_FMT_VER_HIGHEST_READ   29
 
#define SER_FMT_VER_HIGHEST_WRITE   29
 
#define SER_FMT_VER_LOWEST_READ   0
 
#define SER_FMT_VER_LOWEST_WRITE   24
 

Functions

bool ser_ver_supported (s32 v)
 
void compressZlib (const u8 *data, size_t data_size, std::ostream &os, int level=-1)
 
void compressZlib (std::string_view data, std::ostream &os, int level=-1)
 
void decompressZlib (std::istream &is, std::ostream &os, size_t limit=0)
 
void compressZstd (const u8 *data, size_t data_size, std::ostream &os, int level=0)
 
void compressZstd (std::string_view data, std::ostream &os, int level=0)
 
void decompressZstd (std::istream &is, std::ostream &os)
 
void compress (const u8 *data, u32 size, std::ostream &os, u8 version, int level=-1)
 
void compress (std::string_view data, std::ostream &os, u8 version, int level=-1)
 
void decompress (std::istream &is, std::ostream &os, u8 version)
 

Macro Definition Documentation

◆ SER_FMT_VER_HIGHEST_READ

#define SER_FMT_VER_HIGHEST_READ   29

◆ SER_FMT_VER_HIGHEST_WRITE

#define SER_FMT_VER_HIGHEST_WRITE   29

◆ SER_FMT_VER_INVALID

#define SER_FMT_VER_INVALID   255

◆ SER_FMT_VER_LOWEST_READ

#define SER_FMT_VER_LOWEST_READ   0

◆ SER_FMT_VER_LOWEST_WRITE

#define SER_FMT_VER_LOWEST_WRITE   24

Function Documentation

◆ compress() [1/2]

void compress ( const u8 * data,
u32 size,
std::ostream & os,
u8 version,
int level = -1 )

References compressZlib(), compressZstd(), and writeU32().

Referenced by compress(), ModApiUtil::Initialize(), ModApiUtil::InitializeAsync(), ModApiUtil::InitializeClient(), MapBlock::serialize(), Schematic::serializeToMts(), and TestCompression::testRLECompression().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compress() [2/2]

void compress ( std::string_view data,
std::ostream & os,
u8 version,
int level = -1 )
inline

References compress().

+ Here is the call graph for this function:

◆ compressZlib() [1/2]

void compressZlib ( const u8 * data,
size_t data_size,
std::ostream & os,
int level = -1 )

References zerr().

Referenced by TestCompression::_testZlibLimit(), compress(), compressZlib(), encodePNG(), ModApiUtil::l_compress(), Server::SendItemDef(), Server::sendMetadataChanged(), Server::SendNodeDef(), TestCompression::testZlibCompression(), and TestCompression::testZlibLargeData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compressZlib() [2/2]

void compressZlib ( std::string_view data,
std::ostream & os,
int level = -1 )
inline

References compressZlib().

+ Here is the call graph for this function:

◆ compressZstd() [1/2]

void compressZstd ( const u8 * data,
size_t data_size,
std::ostream & os,
int level = 0 )

References dstream.

Referenced by compress(), compressZstd(), ModApiUtil::l_compress(), and TestCompression::testZstdLargeData().

+ Here is the caller graph for this function:

◆ compressZstd() [2/2]

void compressZstd ( std::string_view data,
std::ostream & os,
int level = 0 )
inline

References compressZstd().

+ Here is the call graph for this function:

◆ decompress()

void decompress ( std::istream & is,
std::ostream & os,
u8 version )

References decompressZlib(), decompressZstd(), and readU32().

Referenced by MapBlock::deSerialize(), MapBlock::deSerialize_pre22(), Schematic::deserializeFromMts(), ModApiUtil::Initialize(), ModApiUtil::InitializeAsync(), ModApiUtil::InitializeClient(), and TestCompression::testRLECompression().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decompressZlib()

void decompressZlib ( std::istream & is,
std::ostream & os,
size_t limit = 0 )

References dstream, and zerr().

Referenced by TestCompression::_testZlibLimit(), decompress(), MapBlock::deSerialize_pre22(), Client::handleCommand_ItemDef(), Client::handleCommand_NodeDef(), Client::handleCommand_NodemetaChanged(), ModApiUtil::l_decompress(), TestCompression::testZlibCompression(), and TestCompression::testZlibLargeData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decompressZstd()

void decompressZstd ( std::istream & is,
std::ostream & os )

References dstream.

Referenced by decompress(), ModApiUtil::l_decompress(), TestMapBlock::testSave29(), and TestCompression::testZstdLargeData().

+ Here is the caller graph for this function:

◆ ser_ver_supported()

bool ser_ver_supported ( s32 v)
inline

References SER_FMT_VER_HIGHEST_READ, and SER_FMT_VER_LOWEST_READ.

Referenced by MapBlock::deSerialize(), MapNode::deSerialize(), MapNode::deSerializeBulk(), Client::handleCommand_Hello(), MapBlock::serialize(), MapNode::serialize(), MapNode::serializeBulk(), and MapNode::serializedLength().

+ Here is the caller graph for this function: