Minetest  5.4.0
serialization.h File Reference
#include "irrlichttypes.h"
#include "exceptions.h"
#include <iostream>
#include "util/pointer.h"
+ 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   28
 
#define SER_FMT_VER_HIGHEST_WRITE   28
 
#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 (const std::string &data, std::ostream &os, int level=-1)
 
void decompressZlib (std::istream &is, std::ostream &os, size_t limit=0)
 
void compress (const SharedBuffer< u8 > &data, std::ostream &os, u8 version)
 
void decompress (std::istream &is, std::ostream &os, u8 version)
 

Macro Definition Documentation

◆ SER_FMT_VER_HIGHEST_READ

#define SER_FMT_VER_HIGHEST_READ   28

◆ SER_FMT_VER_HIGHEST_WRITE

#define SER_FMT_VER_HIGHEST_WRITE   28

◆ 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()

void compress ( const SharedBuffer< u8 > &  data,
std::ostream &  os,
u8  version 
)

References compressZlib(), SharedBuffer< T >::getSize(), and writeU32().

Referenced by ModApiUtil::Initialize(), ModApiUtil::InitializeAsync(), ModApiUtil::InitializeClient(), TestCompression::testRLECompression(), and TestCompression::testZlibCompression().

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

◆ compressZlib() [1/2]

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

References compressZlib().

+ Here is the call graph for this function:

◆ compressZlib() [2/2]

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

References zerr().

Referenced by TestCompression::_testZlibLimit(), compress(), compressZlib(), ModApiUtil::l_compress(), Server::SendItemDef(), Server::sendMetadataChanged(), Server::SendNodeDef(), MapBlock::serialize(), MapNode::serializeBulk(), and TestCompression::testZlibLargeData().

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

◆ decompress()

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

References decompressZlib(), and readU32().

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

+ 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(), MapBlock::deSerialize_pre22(), MapNode::deSerializeBulk(), Client::handleCommand_ItemDef(), Client::handleCommand_NodeDef(), Client::handleCommand_NodemetaChanged(), ModApiUtil::l_decompress(), and TestCompression::testZlibLargeData().

+ Here is the call graph for this function:
+ 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: