nlib
|
The library used to implement the MessagePack serializer, the JSON parser/writer, and the CSV parser. More...
Namespaces | |
jsonrpc | |
Implements JSON-RPC 2.0. | |
Classes | |
class | CsvReader |
CSV parser. Reads and parses the CSV string from the stream. More... | |
class | JsonReader |
JSON parser. Reads and parses the JSON string from the stream. More... | |
struct | JsonReaderSettings |
Data structure used to store the JsonReader settings parameters. More... | |
class | JsonWriter |
JSON generator. Converts an MpObject to JSON and writes it to the stream. More... | |
class | MpObject |
Object created when MessagePack or JSON is read. More... | |
struct | MpObjectKv |
A pair consisting of an MpObject -type key and value. Used to store an associative array. More... | |
class | MpReader |
Reads the MessagePack-formatted data from the stream. More... | |
struct | MpReaderSettings |
Data structure used to store the MpReader settings parameters. More... | |
class | MpWalker |
Quickly accesses MessagePack expanded in memory. More... | |
class | MpWriter |
Writes the MessagePack formatted data to the stream. More... | |
struct | nil |
Class that corresponds to nil in MessagePack and null in JSON. More... | |
Functions | |
template<class T > | |
bool | operator== (const nil &lhs, const T &rhs) noexcept |
Returns false if rhs is a non-nil object. | |
template<class T > | |
bool | operator== (const T &lhs, const nil &rhs) noexcept |
Returns false if lhs is a non-nil object. | |
bool | operator== (const nil &lhs, const nil &rhs) noexcept |
Returns true . | |
template<class T > | |
bool | operator!= (const nil &rhs, const T &lhs) noexcept |
Returns true if rhs is a non-nil object. | |
template<class T > | |
bool | operator!= (const T &rhs, const nil &lhs) noexcept |
Returns true if lhs is a non-nil object. | |
bool | operator!= (const nil &rhs, const nil &lhs) noexcept |
Returns false . | |
bool | operator== (const MpObjectKv &lhs, const MpObjectKv &rhs) noexcept |
Recursively compares lhs and rhs and returns true if they are equal. | |
bool | operator!= (const MpObject &lhs, const MpObject &rhs) noexcept |
Recursively compares lhs and rhs and returns false if they are equal. | |
bool | operator!= (const MpObjectKv &lhs, const MpObjectKv &rhs) noexcept |
Recursively compares lhs and rhs and returns false if they are equal. | |
template<class T1 , class T2 > | |
bool | MpRead (MpReader *r, std::pair< T1, T2 > *v) |
Reads the data into pair . | |
template<class T , class Alloc > | |
bool | MpRead (MpReader *r, std::vector< T, Alloc > *v) |
Reads the data into vector . | |
template<class T , class Alloc > | |
bool | MpRead (MpReader *r, Nlist< T, Alloc > *v) |
Reads the data into Nlist . | |
template<class K , class V , class Pr , class Alloc > | |
bool | MpRead (MpReader *r, std::map< K, V, Pr, Alloc > *m) |
Reads the data into map . | |
template<class T1 , class T2 > | |
uint32_t uint64_t nlib_ulong_compatible_t bool | MpWrite (MpWriter *w, const std::pair< T1, T2 > &v) |
Writes the contents of v via MpWriter . | |
bool | MpWrite (MpWriter *w, const char *str) |
Writes str via MpWriter . | |
template<class T , class Alloc > | |
bool | MpWrite (MpWriter *w, const std::vector< T, Alloc > &vec) |
Writes vec via MpWriter . | |
template<class T , class Alloc > | |
bool | MpWrite (MpWriter *w, const Nlist< T, Alloc > &vec) |
Writes vec via MpWriter . | |
template<class K , class V , class Pr , class Alloc > | |
bool | MpWrite (MpWriter *w, const std::map< K, V, Pr, Alloc > &m) |
Writes m via MpWriter . | |
MpObject | |
Free function that handles | |
template<class T > | |
errno_t | Box (MpObject *obj, const T &v) |
This function template can be specialized to define boxing the user type. More... | |
template<class T > | |
errno_t | Unbox (const MpObject *obj, T *v) |
This function template can be specialized to define unboxing the user type. More... | |
bool | operator== (const MpObject &lhs, const MpObject &rhs) |
The two MpObject s are recursively compared. Returns true if they are equivalent. More... | |
MpRead | |
Free function that handles | |
template<class T > | |
bool | MpRead (MpReader *obj, T *v) |
This function template can be made special to define unboxing the user type. More... | |
MpWrite | |
Free function that handles | |
template<class T > | |
bool | MpWrite (MpWriter *obj, const T &v) |
This function template can be specialized to define serializing a user type. More... | |
The library used to implement the MessagePack serializer, the JSON parser/writer, and the CSV parser.
MessagePack
(http://msgpack.org/
) is one format for binary-based object serialization. MessagePack can make data transfers smaller, faster, and more flexible. The data format is similar to JSON translated into binary. MessagePack is commonly used to speed up JSON processing. Like JSON, MessagePack can be written and read in various environments such as Perl, Python, and Ruby. As a result, MessagePack can be used to communicate between different environments and languages.nn::nlib::msgpack
contains the serializer and deserializer, the JSON parser, and the JSON generator that supports MessagePack. MessagePack data and JSON data is converted into the same data format after being read. This allows you to read JSON data and save it as MessagePack, or vice versa.::msgpack
library only understands UTF-8. uint64_t
), signed integer (int64_t
), and floating point value (double
). Any value that is over 19 digits long, not including the sign, is read as a floating point type. Reading the actual value is implemented using the nn::nlib::StrTo
function. nn::nlib::msgpack::Box | ( | MpObject * | obj, |
const T & | v | ||
) |
This function template can be specialized to define boxing the user type.
T | Type of object to be boxed. |
[in] | obj | Object to store the boxed data. |
[in] | v | Object to be boxed. |
0
on success.MpObject
. NULL
value. 0
must be returned when boxing is successful, and a non-zero value must be returned when it is not successful. nn::nlib::msgpack::MpRead | ( | MpReader * | obj, |
T * | v | ||
) |
This function template can be made special to define unboxing the user type.
T | The ype of user-defined object being deserialized. |
[in] | obj | Pointer to the MpReader object. |
[out] | v | User-defined object to be deserialized. |
true
when successful. nn::nlib::msgpack::MpWrite | ( | MpWriter * | obj, |
const T & | v | ||
) |
This function template can be specialized to define serializing a user type.
T | The type of user-defined object being serialized. |
[in] | obj | Pointer to the MpWriter object. |
[in] | v | Object being boxed. |
true
when successful.MpWriter
can be customized by specializing this function template. NULL
value. true
when serialization is successful, and false
when it is not. The two MpObject
s are recursively compared. Returns true
if they are equivalent.
Recursively compares lhs and rhs and returns true
if they are equal.
true
if they are equivalent.nn::nlib::msgpack::Unbox | ( | const MpObject * | obj, |
T * | v | ||
) |
This function template can be specialized to define unboxing the user type.
T | Object to store the data that has been unboxed. |
[in] | obj | Object that stores the boxed data. |
[in] | v | Object to store the unboxed data. |
0
on success.NULL
value. 0
must be returned when unboxing is successful, and a non-zero value must be returned when it is not successful. © 2013, 2014, 2015 Nintendo Co., Ltd. All rights reserved.