Class MsgPack

Class Documentation

class MsgPack

Public Types

enum Type

Values:

enumerator NUMBER
enumerator INT
enumerator NUL
enumerator FLOAT32
enumerator FLOAT64
enumerator INT8
enumerator INT16
enumerator INT32
enumerator INT64
enumerator UINT8
enumerator UINT16
enumerator UINT32
enumerator UINT64
enumerator BOOL
enumerator STRING
enumerator BINARY
enumerator ARRAY
enumerator OBJECT
enumerator EXTENSION
typedef std::vector<MsgPack> array
typedef std::map<MsgPack, MsgPack> object
typedef std::vector<uint8_t> binary
typedef std::tuple<int8_t, binary> extension
typedef std::initializer_list<std::pair<std::string, Type>> shape

Public Functions

MsgPack() noexcept
MsgPack(std::nullptr_t) noexcept
MsgPack(float value)
MsgPack(double value)
MsgPack(int8_t value)
MsgPack(int16_t value)
MsgPack(int32_t value)
MsgPack(int64_t value)
MsgPack(uint8_t value)
MsgPack(uint16_t value)
MsgPack(uint32_t value)
MsgPack(uint64_t value)
MsgPack(bool value)
MsgPack(const std::string &value)
MsgPack(std::string &&value)
MsgPack(const char *value)
MsgPack(const array &values)
MsgPack(array &&values)
MsgPack(const object &values)
MsgPack(object &&values)
MsgPack(const binary &values)
MsgPack(binary &&values)
MsgPack(const extension &values)
MsgPack(extension &&values)
template<class T, class = decltype(&T::to_msgpack)>
inline MsgPack(const T &t)
template<class M, typename std::enable_if<std::is_constructible<MsgPack, typename M::key_type>::value && std::is_constructible<MsgPack, typename M::mapped_type>::value, int>::type = 0>
inline MsgPack(const M &m)
template<class V, typename std::enable_if<std::is_constructible<MsgPack, typename V::value_type>::value && !std::is_same<typename binary::value_type, typename V::value_type>::value, int>::type = 0>
inline MsgPack(const V &v)
template<class V, typename std::enable_if<std::is_constructible<MsgPack, typename V::value_type>::value && std::is_same<typename binary::value_type, typename V::value_type>::value, int>::type = 0>
inline MsgPack(const V &v)
MsgPack(void*) = delete
Type type() const
inline bool is_null() const
inline bool is_bool() const
inline bool is_number() const
inline bool is_float32() const
inline bool is_float64() const
inline bool is_int() const
inline bool is_int8() const
inline bool is_int16() const
inline bool is_int32() const
inline bool is_int64() const
inline bool is_uint8() const
inline bool is_uint16() const
inline bool is_uint32() const
inline bool is_uint64() const
inline bool is_string() const
inline bool is_array() const
inline bool is_binary() const
inline bool is_object() const
inline bool is_extension() const
double number_value() const
float float32_value() const
double float64_value() const
int32_t int_value() const
int8_t int8_value() const
int16_t int16_value() const
int32_t int32_value() const
int64_t int64_value() const
uint8_t uint8_value() const
uint16_t uint16_value() const
uint32_t uint32_value() const
uint64_t uint64_value() const
bool bool_value() const
const std::string &string_value() const
const array &array_items() const
const object &object_items() const
const binary &binary_items() const
const extension &extension_items() const
const MsgPack &operator[](size_t i) const
const MsgPack &operator[](const std::string &key) const
inline void dump(std::string &out) const
inline std::string dump() const
bool operator==(const MsgPack &rhs) const
bool operator<(const MsgPack &rhs) const
inline bool operator!=(const MsgPack &rhs) const
inline bool operator<=(const MsgPack &rhs) const
inline bool operator>(const MsgPack &rhs) const
inline bool operator>=(const MsgPack &rhs) const
bool has_shape(const shape &types, std::string &err) const

Public Static Functions

static MsgPack parse(const std::string &in, std::string &err)
static MsgPack parse(std::istream &is, std::string &err)
static MsgPack parse(std::istream &is)
static inline MsgPack parse(const char *in, size_t len, std::string &err)
static std::vector<MsgPack> parse_multi(const std::string &in, std::string::size_type &parser_stop_pos, std::string &err)
static inline std::vector<MsgPack> parse_multi(const std::string &in, std::string &err)

Friends

friend std::ostream &operator<<(std::ostream &os, const MsgPack &msgpack)
friend std::istream &operator>>(std::istream &is, MsgPack &msgpack)