nlib
|
メモリ上に展開されたMessagePackのデータに高速にアクセスします。 [詳解]
#include "nn/nlib/msgpack/MpWalker.h"
公開メンバ関数 | |
MpWalker | operator[] (size_t array_idx) const noexcept |
インデックスを指定して配列の要素にアクセスします。 [詳解] | |
MpWalker | operator[] (const nlib_utf8_t *key) const noexcept |
文字列を指定して連想配列の要素にアクセスします。 [詳解] | |
MpWalker | operator[] (int array_idx) const noexcept |
operator[](size_t array_idx) と同様です。 | |
const void * | GetPtr () const noexcept |
MessagePackデータの現在位置へのポインタを取得します。 [詳解] | |
size_t | GetSize () const noexcept |
MessagePackデータのサイズを取得します。 [詳解] | |
MpWalker | At (size_t idx) const noexcept |
operator[](size_t array_idx) と同じです。 | |
MpWalker | At (size_t idx, const nlib_utf8_t **key, size_t *n) const noexcept |
インデックスを指定して連想配列の要素にアクセスします。 [詳解] | |
MpWalker | Find (const nlib_utf8_t *key) const noexcept |
operator[](const nlib_utf8_t* key) と同じです。 | |
MpWalker | GetString (const nlib_utf8_t **str, uint32_t *n) const noexcept |
str format のデータを取得します。 [詳解] | |
MpWalker | GetBinary (const void **bin, uint32_t *n) const noexcept |
bin format のデータを取得します。 [詳解] | |
MpWalker | GetExt (int8_t *tp, const void **bin, uint32_t *n) const noexcept |
ext format のデータを取得します。 [詳解] | |
MpWalker | GetMapCount (uint32_t *n) const noexcept |
連想配列のサイズを取得します。 [詳解] | |
MpWalker | GetArrayCount (uint32_t *n) const noexcept |
配列のサイズを取得します。 [詳解] | |
MpWalker | GetNil () const noexcept |
nil を取得します。 [詳解] | |
MpWalker | GetBoolean (bool *val) const noexcept |
true かfalse を取得します。 [詳解] | |
MpWalker | GetInt (int32_t *val) const noexcept |
符号付き整数値を取得します。 [詳解] | |
MpWalker | GetInt (int64_t *val) const noexcept |
符号付き整数値を取得します。 [詳解] | |
MpWalker | GetUint (uint32_t *val) const noexcept |
符号なし整数値を取得します。 [詳解] | |
MpWalker | GetUint (uint64_t *val) const noexcept |
符号なし整数値を取得します。 [詳解] | |
MpWalker | GetFloat (float *val) const noexcept |
単精度浮動小数点数を取得します。 [詳解] | |
MpWalker | GetDouble (double *val) const noexcept |
倍精度浮動小数点数を取得します。 [詳解] | |
operator bool () const | |
オブジェクトが初期化されて読み込み可能であればtrue を返します。 | |
基本的なメンバ関数 | |
MpWalker () noexcept | |
デフォルトコンストラクタです。 | |
~MpWalker () noexcept | |
デストラクタです。 | |
初期化と終了 | |
MpWalker (const void *p, size_t n) noexcept | |
コンストラクタです。 [詳解] | |
bool | Init (const void *p, size_t n) noexcept |
デフォルトコンストラクタを利用した場合はこの関数で初期化します。 [詳解] | |
メモリ上に展開されたMessagePackのデータに高速にアクセスします。
MpReader
を利用してMessagePackのデータを読み込む場合、ツリー状にMpObject
が構築されます。 この動作は便利なのですが、必要でないデータに関してもMpObject
が構築されることになります。 MpWalker
を利用して連想配列のキーや配列のインデックスを指定して必要な部分に移動してから、MpReader
を利用することで必要なデータについてのみMpObject
を構築すれば、効率よくMessagePackのデータを利用することが可能になります。 MpObject
として構築するコード例を以下に示します。 MpWalker.h の 31 行目に定義があります。
|
noexcept |
コンストラクタです。
[in] | p | MessagePackデータへのポインタ |
[in] | n | データサイズ |
|
noexcept |
インデックスを指定して連想配列の要素にアクセスします。
[in] | idx | 連想配列のインデックス |
[out] | key | 対応する連想配列のキー(ヌル終端しません) |
[out] | n | 対応する連想配列のキーの長さ |
MpWalker
オブジェクト
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
ext format
のデータを取得します。
[out] | tp | オブジェクトの型を示す数値 |
[out] | bin | バイナリへのポインタ |
[out] | n | バイナリの長さ |
MpWalker
オブジェクト
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
nil
を取得します。
MpWalker
オブジェクト
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
str format
のデータを取得します。
[out] | str | 文字列(ヌル終端しません)へのポインタ |
[out] | n | 文字列の長さ |
MpWalker
オブジェクト
|
noexcept |
|
noexcept |
|
inlinenoexcept |
デフォルトコンストラクタを利用した場合はこの関数で初期化します。
[in] | p | MessagePackデータへのポインタ |
[in] | n | データサイズ |
true
(常に成功) MpWalker.h の 36 行目に定義があります。
|
noexcept |
|
noexcept |
© 2012-2017 Nintendo Co., Ltd. All rights reserved.