JSON Voorhees
Killer JSON for C++
jsonv::path Class Reference

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

#include <jsonv/path.hpp>

+ Inheritance diagram for jsonv::path:

Public Member Functions

 path ()
 Creates a new, empty path. More...
 
 path (storage_type elements)
 Creates a path with the provided elements. More...
 
 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. More...
 
pathoperator+= (const path &subpath)
 
path operator+ (path_element elem) const
 Return a new path with the given elem appended to the back. More...
 
pathoperator+= (path_element elem)
 
- Public Member Functions inherited from jsonv::detail::generic_container< std::vector< path_element > >
 generic_container (storage_type data)
 
 generic_container (TInputIterator first, TInputIterator last)
 
 generic_container (const generic_container &)=default
 
 generic_container (generic_container &&) noexcept=default
 
generic_containeroperator= (const generic_container &)=default
 
generic_containeroperator= (generic_container &&)=default
 
size_type size () const
 Get the number of elements. More...
 
bool empty () const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cend () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator crbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
const_reverse_iterator crend () const
 
reference operator[] (size_type idx)
 
const_reference operator[] (size_type idx) const
 
reference at (size_type idx)
 
const_reference at (size_type idx) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
void clear ()
 
iterator insert (const_iterator pos, const value_type &x)
 
iterator insert (const_iterator pos, value_type &&x)
 
iterator insert (const_iterator pos, TInputIterator first, TInputIterator last)
 
iterator insert (const_iterator pos, std::initializer_list< value_type > ilist)
 
iterator emplace (const_iterator pos, TArgs &&...args)
 
void emplace_back (TArgs &&...args)
 
void push_back (const value_type &x)
 
void push_back (value_type &&x)
 
iterator erase (const_iterator pos)
 
iterator erase (const_iterator first, const_iterator last)
 
void pop_back ()
 

Static Public Member Functions

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

Additional Inherited Members

- Public Types inherited from jsonv::detail::generic_container< std::vector< path_element > >
using storage_type = std::vector< path_element >
 
using size_type = typename storage_type::size_type
 
using value_type = typename storage_type::value_type
 
using difference_type = typename storage_type::difference_type
 
using iterator = typename storage_type::iterator
 
using const_iterator = typename storage_type::const_iterator
 
using reverse_iterator = typename storage_type::reverse_iterator
 
using const_reverse_iterator = typename storage_type::const_reverse_iterator
 
using reference = typename storage_type::reference
 
using const_reference = typename storage_type::const_reference
 
using pointer = typename storage_type::pointer
 
using const_pointer = typename storage_type::const_pointer
 
using allocator_type = typename storage_type::allocator_type
 
- Protected Attributes inherited from jsonv::detail::generic_container< std::vector< path_element > >
storage_type _data
 

Detailed Description

Represents an exact path in some JSON structure.

Definition at line 82 of file path.hpp.

Constructor & Destructor Documentation

jsonv::path::path ( )

Creates a new, empty path.

jsonv::path::path ( storage_type  elements)

Creates a path with the provided elements.

Member Function Documentation

static path jsonv::path::create ( 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.
path jsonv::path::operator+ ( const path subpath) const

Return a new path with the given subpath appended to the back.

path jsonv::path::operator+ ( path_element  elem) const

Return a new path with the given elem appended to the back.


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