JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
jsonv::path Class Reference

Represents an exact path in some JSON structure. More...

#include <jsonv/path.hpp>

+ Inheritance diagram for jsonv::path:
+ Collaboration diagram for jsonv::path:

Public Member Functions

 path ()
 Creates a new, empty path.
 
 path (storage_type elements)
 Creates a path with the provided elements.
 
 path (const path &)
 
pathoperator= (const path &)
 
 path (path &&) noexcept
 
pathoperator= (path &&) noexcept
 
path operator+ (const path &subpath) const
 Return a new path with the given subpath appended to the back.
 
pathoperator+= (const path &subpath)
 
path operator+ (path_element elem) const
 Return a new path with the given elem appended to the back.
 
pathoperator+= (path_element elem)
 

Static Public Member Functions

static path create (std::string_view specification)
 Create a path from a string definition.
 

Detailed Description

Represents an exact path in some JSON structure.

Definition at line 81 of file path.hpp.

Member Function Documentation

◆ create()

static path jsonv::path::create ( std::string_view  specification)
static

Create a path from a string definition.

The syntax of this is ECMAScript's syntax for selecting elements, so path::create(".foo.bar[1]") is equivalent to path({ "foo", "bar", 1 }).

Exceptions
std::invalid_argumentif the specification is not valid.

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