nlib
|
Quickly accesses MessagePack
expanded in memory.
More...
#include "nn/nlib/msgpack/MpWalker.h"
Public Member Functions | |
MpWalker | operator[] (size_t array_idx) const noexcept |
Specifies an index and accesses the element in the array. More... | |
MpWalker | operator[] (const nlib_utf8_t *key) const noexcept |
Specifies a string and accesses the element in the associative array. More... | |
MpWalker | operator[] (int array_idx) const noexcept |
The same as operator[](size_t array_idx) . | |
const void * | GetPtr () const noexcept |
Gets a pointer to the current location of MessagePack data. More... | |
size_t | GetSize () const noexcept |
Gets the size of the MessagePack data. More... | |
MpWalker | At (size_t idx) const noexcept |
Provides the same function as operator[](size_t array_idx) . | |
MpWalker | At (size_t idx, const nlib_utf8_t **key, size_t *n) const noexcept |
Specifies an index and accesses the element in the associative array. More... | |
MpWalker | Find (const nlib_utf8_t *key) const noexcept |
Provides the same function as operator[](const nlib_utf8_t* key) . | |
MpWalker | GetString (const nlib_utf8_t **str, uint32_t *n) const noexcept |
Gets the str format data. More... | |
MpWalker | GetBinary (const void **bin, uint32_t *n) const noexcept |
Gets the bin format data. More... | |
MpWalker | GetExt (int8_t *tp, const void **bin, uint32_t *n) const noexcept |
Gets the ext format data. More... | |
MpWalker | GetMapCount (uint32_t *n) const noexcept |
Gets the associative array size. More... | |
MpWalker | GetArrayCount (uint32_t *n) const noexcept |
Gets the array size. More... | |
MpWalker | GetNil () const noexcept |
Gets nil . More... | |
MpWalker | GetBoolean (bool *val) const noexcept |
Gets true or false . More... | |
MpWalker | GetInt (int32_t *val) const noexcept |
Gets a signed integer value. More... | |
MpWalker | GetInt (int64_t *val) const noexcept |
Gets a signed integer value. More... | |
MpWalker | GetUint (uint32_t *val) const noexcept |
Gets an unsigned integer value. More... | |
MpWalker | GetUint (uint64_t *val) const noexcept |
Gets an unsigned integer value. More... | |
MpWalker | GetFloat (float *val) const noexcept |
Gets a single-precision floating-point number. More... | |
MpWalker | GetDouble (double *val) const noexcept |
Gets a double-precision floating-point number. More... | |
operator bool () const | |
Returns true if the object is initialized and readable. | |
Basic Member Functions | |
MpWalker () noexcept | |
Instantiates the object with default parameters (default constructor). | |
~MpWalker () noexcept | |
Destructor. | |
Initialization and Finalization | |
MpWalker (const void *p, size_t n) noexcept | |
Instantiates the object. More... | |
bool | Init (const void *p, size_t n) noexcept |
Initialize with this function when using the default constructor. More... | |
Quickly accesses MessagePack
expanded in memory.
MpObject
is constructed in a tree when using MpReader
to read MessagePack data. This behavior is convenient, but means that MpObject
is also built for unnecessary data. MessagePack
data more efficiently by building the MpObject
for only the necessary data. To do this, use MpWalker
to specify the key of an associative array or an index of an array, move to the required location, and then use MpReader
. MpObject
using only information under the key
attribute. Definition at line 31 of file MpWalker.h.
|
noexcept |
Instantiates the object.
[in] | p | Pointer to MessagePack data. |
[in] | n | Data size. |
|
noexcept |
Specifies an index and accesses the element in the associative array.
[in] | idx | Index of the associative array index. |
[out] | key | Corresponding key of the associative array (Not null terminated). |
[out] | n | Length of the key of the corresponding associative array. |
MpWalker
object pointing to the value of an associative array.
|
noexcept |
Gets the array size.
[out] | n | Size of the array. |
MpWalker
object pointing to the next element (the first element in the array).
|
noexcept |
Gets the bin format
data.
[out] | bin | Pointer to the binary. |
[out] | n | Length of the binary. |
MpWalker
object pointing to the next element.
|
noexcept |
Gets true
or false
.
[out] | val | Pointer to the boolean value. |
MpWalker
object pointing to the next element.
|
noexcept |
Gets a double-precision floating-point number.
[out] | val | Pointer to the double-precision floating-point number. |
MpWalker
object pointing to the next element.
|
noexcept |
Gets the ext format
data.
[out] | tp | Numeric value indicating the object type. |
[out] | bin | Pointer to the binary. |
[out] | n | Length of the binary. |
MpWalker
object pointing to the next element.
|
noexcept |
Gets a single-precision floating-point number.
[out] | val | Pointer to the single-precision floating-point number. |
MpWalker
object pointing to the next element.
|
noexcept |
Gets a signed integer value.
[out] | val | Pointer to the signed integer value. |
MpWalker
object pointing to the next element.
|
noexcept |
Gets a signed integer value.
[out] | val | Pointer to the signed integer value. |
MpWalker
object pointing to the next element.
|
noexcept |
Gets the associative array size.
[out] | n | Size of the associative array. |
MpWalker
object pointing to the next element (the first key in the associative array).
|
noexcept |
Gets nil
.
MpWalker
object pointing to the next element.
|
inlinenoexcept |
Gets a pointer to the current location of MessagePack data.
Definition at line 52 of file MpWalker.h.
|
inlinenoexcept |
Gets the size of the MessagePack data.
Definition at line 53 of file MpWalker.h.
|
noexcept |
Gets the str format
data.
[out] | str | Pointer to the string (Not null terminated). |
[out] | n | Length of the string. |
MpWalker
object pointing to the next element.
|
noexcept |
Gets an unsigned integer value.
[out] | val | Pointer to the unsigned integer value. |
MpWalker
object pointing to the next element.
|
noexcept |
Gets an unsigned integer value.
[out] | val | Pointer to the unsigned integer value. |
MpWalker
object pointing to the next element.
|
inlinenoexcept |
Initialize with this function when using the default constructor.
[in] | p | Pointer to MessagePack data. |
[in] | n | Data size. |
true
on success. (Always successful.) Definition at line 36 of file MpWalker.h.
|
noexcept |
Specifies an index and accesses the element in the array.
[in] | array_idx | Array index. |
MpWalker
object pointing to the value of an array element.MpWalker
indicating an array element. If not an array, or the specified index does not exist, returns an MpWalker
object constructed by the default constructor.
|
noexcept |
Specifies a string and accesses the element in the associative array.
[in] | key | Associative array key. |
MpWalker
object pointing to the value of an associative array.MpWalker
indicating an associative array element. If not an associative array, or the specified index does not exist, returns an MpWalker
object constructed by the default constructor. © 2012-2017 Nintendo Co., Ltd. All rights reserved.