NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
nim_cpp_wrapper_util::Json::Path类 参考

Experimental and untested: represents a "path" to access a node. 更多...

#include <value.h>

Public 成员函数

 Path (const String &path, const PathArgument &a1=PathArgument(), const PathArgument &a2=PathArgument(), const PathArgument &a3=PathArgument(), const PathArgument &a4=PathArgument(), const PathArgument &a5=PathArgument())
 
const Valueresolve (const Value &root) const
 
Value resolve (const Value &root, const Value &defaultValue) const
 
Valuemake (Value &root) const
 

Private 类型

using InArgs = std::vector< const PathArgument * >
 
using Args = std::vector< PathArgument >
 

Private 成员函数

void makePath (const String &path, const InArgs &in)
 
void addPathInArg (const String &path, const InArgs &in, InArgs::const_iterator &itInArg, PathArgument::Kind kind)
 

静态 Private 成员函数

static void invalidPath (const String &path, int location)
 

Private 属性

Args args_
 

详细描述

Experimental and untested: represents a "path" to access a node.

Syntax:

  • "." => root node
  • ".[n]" => elements at index 'n' of root node (an array value)
  • ".name" => member named 'name' of root node (an object value)
  • ".name1.name2.name3"
  • ".[0][1][2].name1[3]"
  • ".%" => member name is provided as parameter
  • ".[%]" => index is provided as parameter

成员类型定义说明

◆ Args

◆ InArgs

using nim_cpp_wrapper_util::Json::Path::InArgs = std::vector<const PathArgument*>
private

构造及析构函数说明

◆ Path()

nim_cpp_wrapper_util::Json::Path::Path ( const String path,
const PathArgument a1 = PathArgument(),
const PathArgument a2 = PathArgument(),
const PathArgument a3 = PathArgument(),
const PathArgument a4 = PathArgument(),
const PathArgument a5 = PathArgument() 
)

成员函数说明

◆ addPathInArg()

void nim_cpp_wrapper_util::Json::Path::addPathInArg ( const String path,
const InArgs in,
InArgs::const_iterator &  itInArg,
PathArgument::Kind  kind 
)
private

◆ invalidPath()

void nim_cpp_wrapper_util::Json::Path::invalidPath ( const String path,
int  location 
)
staticprivate

◆ make()

Value & nim_cpp_wrapper_util::Json::Path::make ( Value root) const

Creates the "path" to access the specified node and returns a reference on the node.

◆ makePath()

void nim_cpp_wrapper_util::Json::Path::makePath ( const String path,
const InArgs in 
)
private

◆ resolve() [1/2]

const Value & nim_cpp_wrapper_util::Json::Path::resolve ( const Value root) const

◆ resolve() [2/2]

Value nim_cpp_wrapper_util::Json::Path::resolve ( const Value root,
const Value defaultValue 
) const

类成员变量说明

◆ args_

Args nim_cpp_wrapper_util::Json::Path::args_
private

该类的文档由以下文件生成: