#include <string.h>
#include <cstdint>
#include <limits>
#include <type_traits>
#include <string>
#include <stdexcept>
#include <memory>
Go to the source code of this file.
|
| void | ebml::_reverse (char *s, unsigned int j, unsigned int k) |
| | Reverses the contents of a character array between indices [j, k]. More...
|
| |
| template<typename T > |
| size_t | ebml::size (const T &value) |
| | Computes the size in bytes required to encode the given value. More...
|
| |
| template<typename T > |
| size_t | ebml::pack (const T &value, char *dest) |
| | Packs the given value into a raw data buffer. More...
|
| |
| template<typename T > |
| size_t | ebml::pack (const T &value, size_t size, char *dest) |
| | Packs the given value into a raw data buffer with a size constraint. More...
|
| |
| template<typename T > |
| std::string | ebml::pack (const T &value) |
| | Packs the given value into a std::string. More...
|
| |
| template<typename T > |
| T | ebml::unpack (const char *src, size_t size) |
| | Unpacks a value of type T from a raw data buffer. More...
|
| |
| template<typename T > |
| T | ebml::unpack (const std::string &str) |
| | Unpacks a value of type T from a std::string. More...
|
| |
◆ DECL_EXTERN_FUNCTIONS
| #define DECL_EXTERN_FUNCTIONS |
( |
|
T | ) |
|
Value: size_t
pack(
const T&,
size_t,
char*); \
template<> \
T unpack<T>(const char*, size_t); \
extern
template size_t pack(
const T&,
char*); \
DECL_EXTERN_STR_FUNCTIONS(T)
size_t size(const T &value)
Computes the size in bytes required to encode the given value.
std::string pack(const T &value)
Packs the given value into a std::string.
◆ DECL_EXTERN_FUNCTIONS_ALT
| #define DECL_EXTERN_FUNCTIONS_ALT |
( |
|
T | ) |
|
Value: size_t
pack(
const T&,
char*); \
template<> \
T unpack<T>(const char*, size_t); \
extern
template size_t pack(
const T&,
size_t,
char*); \
DECL_EXTERN_STR_FUNCTIONS(T)
size_t size(const T &value)
Computes the size in bytes required to encode the given value.
std::string pack(const T &value)
Packs the given value into a std::string.
◆ DECL_EXTERN_FUNCTIONS_ALT2
| #define DECL_EXTERN_FUNCTIONS_ALT2 |
( |
|
T | ) |
|
Value: size_t
pack(
const T&,
char*); \
size_t
pack(
const T&,
size_t,
char*); \
template<> \
T unpack<T>(const char*, size_t); \
DECL_EXTERN_STR_FUNCTIONS(T)
size_t size(const T &value)
Computes the size in bytes required to encode the given value.
std::string pack(const T &value)
Packs the given value into a std::string.
◆ DECL_EXTERN_STR_FUNCTIONS
| #define DECL_EXTERN_STR_FUNCTIONS |
( |
|
T | ) |
|
Value:extern template std::string
pack(
const T&); \
extern template T unpack<T>(const std::string&);
std::string pack(const T &value)
Packs the given value into a std::string.
◆ DEF_PACK
| #define DEF_PACK |
( |
|
T | ) |
inline size_t pack(const T& value, size_t size, char* dest) |
◆ DEF_PACK_ALT
| #define DEF_PACK_ALT |
( |
|
T | ) |
inline size_t pack(const T& value, char* dest) |
◆ DEF_SIZE
| #define DEF_SIZE |
( |
|
T | ) |
inline size_t size(const T& value) |
◆ DEF_UNPACK
Value:template<> \
inline T unpack<T>(
const char* src,
size_t size)
size_t size(const T &value)
Computes the size in bytes required to encode the given value.
◆ FIXED_SIZE
| #define FIXED_SIZE |
( |
|
T, |
|
|
|
s |
|
) |
| |
Value:inline size_t size(
const T&) { \
return s; \
}
size_t size(const T &value)
Computes the size in bytes required to encode the given value.
◆ INST_STRING_TEMPLATES
| #define INST_STRING_TEMPLATES |
( |
|
T | ) |
|
Value:template std::string
pack(
const T&); \
template T unpack<T>(const std::string&);
std::string pack(const T &value)
Packs the given value into a std::string.
◆ INST_TEMPLATES
| #define INST_TEMPLATES |
( |
|
T | ) |
|
Value:template size_t pack(
const T&,
char*); \
INST_STRING_TEMPLATES(T)
std::string pack(const T &value)
Packs the given value into a std::string.
◆ INST_TEMPLATES_ALT
| #define INST_TEMPLATES_ALT |
( |
|
T | ) |
|
Value:template size_t pack(
const T&,
size_t,
char*); \
INST_STRING_TEMPLATES(T)
std::string pack(const T &value)
Packs the given value into a std::string.