Myra Canyon  v0.0.1-768
network control
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Json::Path Class Reference

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

#include "json.h"

Collaboration diagram for Json::Path:

Public Member Functions

 Path (const std::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
 Creates the "path" to access the specified node and returns a reference on the node. More...
 

Private Types

typedef std::vector< const
PathArgument * > 
InArgs
 
typedef std::vector< PathArgumentArgs
 

Private Member Functions

void makePath (const std::string &path, const InArgs &in)
 
void addPathInArg (const std::string &path, const InArgs &in, InArgs::const_iterator &itInArg, PathArgument::Kind kind)
 
void invalidPath (const std::string &path, int location)
 

Private Attributes

Args args_
 

Detailed Description

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 provied as parameter

Member Typedef Documentation

typedef std::vector<PathArgument> Json::Path::Args
private
typedef std::vector<const PathArgument*> Json::Path::InArgs
private

Constructor & Destructor Documentation

Json::Path::Path ( const std::string &  path,
const PathArgument a1 = PathArgument(),
const PathArgument a2 = PathArgument(),
const PathArgument a3 = PathArgument(),
const PathArgument a4 = PathArgument(),
const PathArgument a5 = PathArgument() 
)

Here is the call graph for this function:

Member Function Documentation

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

Here is the caller graph for this function:

void Json::Path::invalidPath ( const std::string &  path,
int  location 
)
private

Here is the caller graph for this function:

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

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

Here is the call graph for this function:

void Json::Path::makePath ( const std::string &  path,
const InArgs in 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

Member Data Documentation

Args Json::Path::args_
private

The documentation for this class was generated from the following files: