载入中...
搜索中...
未找到
eve::data 命名空间参考

命名空间

namespace  impl
 

类

class  ByteData
 In-memory byte buffer implementing eve::Data (ref-counted). 更多...
 
class  CompressedData
 Stores byte data compressed via DataModule::compress. 更多...
 
class  Compressor
 Base class for backends for different compression formats. 更多...
 
class  DataModule
 EVENGINE_API_FOUNDATION public API. 更多...
 
class  DataView
 Contains a reference to a subsection of an existing Data object. 更多...
 
class  HashFunction
 EVENGINE_API_FOUNDATION public API. 更多...
 
class  JsonDocument
 Thin RAII wrapper over a Poco JSON value (object/array/scalar). 更多...
 
class  LZ4Compressor
 
class  XmlDocument
 Thin RAII wrapper over a Poco XML DOM document. 更多...
 
class  zlibCompressor
 

枚举

enum  ContainerType { CONTAINER_DATA , CONTAINER_STRING , CONTAINER_MAX_ENUM }
 ContainerType public API. 更多...
 

函数

 Module_IMPL (DataModule, new DataModule())
 
CompressedData * compress (std::string format, const char *rawbytes, size_t rawsize, int level=-1)
 Compresses a block of memory using the given compression format.
 
char * decompress (CompressedData *data, size_t &decompressedsize)
 Decompresses existing compressed data into raw bytes.
 
char * decompress (std::string format, const char *cbytes, size_t compressedsize, size_t &rawsize)
 Decompresses existing compressed data into raw bytes.
 
char * encode (std::string format, const char *src, size_t srclen, size_t &dstlen, size_t linelen=0)
 Encodes raw bytes (e.g. hex / base64) into a text buffer.
 
char * decode (std::string format, const char *src, size_t srclen, size_t &dstlen)
 Decodes a text buffer (hex / base64) back into raw bytes.
 
std::string hash (std::string function, Data *input)
 Hash the input, producing an set of bytes as output.
 
std::string hash (std::string function, const char *input, uint64_t size)
 Hash.
 
void hash (std::string function, Data *input, HashFunction::Value &output)
 Hash.
 
void hash (std::string function, const char *input, uint64_t size, HashFunction::Value &output)
 Hash.
 

枚举类型说明

◆ ContainerType

ContainerType public API.

枚举值
CONTAINER_DATA 
CONTAINER_STRING 
CONTAINER_MAX_ENUM 

在文件 DataModule.h 第 23 行定义.

函数说明

◆ compress()

EVENGINE_API_FOUNDATION CompressedData * eve::data::compress ( std::string  format,
const char *  rawbytes,
size_t  rawsize,
int  level = -1 
)

Compresses a block of memory using the given compression format.

参数
formatThe compression format to use.
rawbytesThe data to compress.
rawsizeThe size in bytes of the data to compress.
levelThe amount of compression to apply (between 0 and 9.) A value of -1 indicates the default amount of compression. Specific formats may not use every level.
返回
The newly compressed data. @ownership Caller owns the returned CompressedData and releases it through its documented destroy path. @lifetime The returned data is independent of rawbytes and remains valid until released.

在文件 DataModule.cpp 第 158 行定义.

引用了 eve::data::Compressor::compress(), eve::data::Compressor::getCompressor() , 以及 level.

◆ decode()

EVENGINE_API_FOUNDATION char * eve::data::decode ( std::string  format,
const char *  src,
size_t  srclen,
size_t &  dstlen 
)

Decodes a text buffer (hex / base64) back into raw bytes.

参数
formatThe encoding format ("hex" or "base64").
srcThe encoded text.
srclenSize in bytes of src.
[out]dstlenReceives the decoded length in bytes.
返回
The newly allocated decoded buffer (allocated with new[]; caller frees). @ownership Caller owns the returned buffer and releases it with delete[]. @lifetime The returned buffer is independent of src and remains valid until freed.
异常
eve::Exceptionon an unsupported format or malformed input.

在文件 DataModule.cpp 第 212 行定义.

引用了 eve::b64_decode().

◆ decompress() [1/2]

EVENGINE_API_FOUNDATION char * eve::data::decompress ( CompressedData *  data,
size_t &  decompressedsize 
)

Decompresses existing compressed data into raw bytes.

参数
[in]dataThe compressed data to decompress.
[out]decompressedsizeThe size in bytes of the decompressed data.
返回
The newly decompressed data (allocated with new[]). @ownership Caller owns the returned buffer and releases it with delete[]. @lifetime The returned buffer is independent of the compressed input and remains valid until freed.

在文件 DataModule.cpp 第 183 行定义.

引用了 decompress().

被这些函数引用 decompress().

◆ decompress() [2/2]

EVENGINE_API_FOUNDATION char * eve::data::decompress ( std::string  format,
const char *  cbytes,
size_t  compressedsize,
size_t &  rawsize 
)

Decompresses existing compressed data into raw bytes.

参数
[in]formatThe compression format the data is in.
[in]cbytesThe compressed data to decompress.
[in]compressedsizeThe size in bytes of the compressed data.
[in,out]rawsizeOn input, the size in bytes of the original uncompressed data, or 0 if unknown. On return, the size in bytes of the newly decompressed data.
返回
The newly decompressed data (allocated with new[]).

在文件 DataModule.cpp 第 194 行定义.

引用了 eve::data::Compressor::decompress() , 以及 eve::data::Compressor::getCompressor().

◆ encode()

EVENGINE_API_FOUNDATION char * eve::data::encode ( std::string  format,
const char *  src,
size_t  srclen,
size_t &  dstlen,
size_t  linelen = 0 
)

Encodes raw bytes (e.g. hex / base64) into a text buffer.

参数
formatThe encoding format ("hex" or "base64").
srcThe raw bytes to encode.
srclenSize in bytes of src.
[out]dstlenReceives the encoded length in bytes.
linelenLine width for the encoded output (0 = single line).
返回
The newly allocated encoded buffer (allocated with new[]; caller frees). @ownership Caller owns the returned buffer and releases it with delete[]. @lifetime The returned buffer is independent of src and remains valid until freed.
异常
eve::Exceptionon an unsupported format.

在文件 DataModule.cpp 第 204 行定义.

引用了 eve::b64_encode().

◆ hash() [1/4]

EVENGINE_API_FOUNDATION std::string eve::data::hash ( std::string  function,
const char *  input,
uint64_t  size 
)

Hash.

在文件 DataModule.cpp 第 225 行定义.

引用了 function, hash, input, output , 以及 size.

◆ hash() [2/4]

EVENGINE_API_FOUNDATION void eve::data::hash ( std::string  function,
const char *  input,
uint64_t  size,
HashFunction::Value &  output 
)

◆ hash() [3/4]

EVENGINE_API_FOUNDATION std::string eve::data::hash ( std::string  function,
Data *  input 
)

Hash the input, producing an set of bytes as output.

参数
[in]functionThe selected hash function.
[in]inputThe input data to hash.
返回
An std::string of bytes, representing the result of the hash function.

在文件 DataModule.cpp 第 220 行定义.

引用了 function, hash , 以及 input.

◆ hash() [4/4]

EVENGINE_API_FOUNDATION void eve::data::hash ( std::string  function,
Data *  input,
HashFunction::Value &  output 
)

Hash.

在文件 DataModule.cpp 第 232 行定义.

引用了 function, hash, input , 以及 output.

◆ Module_IMPL()

eve::data::Module_IMPL ( DataModule  ,
new   DataModule() 
)