JSON for Modern C++ 3.8.0

back
basic_json
empty
json_pointer
operator std::string
operator!=
operator/
operator/
operator/
operator/=
operator/=
operator/=
operator==
parent_pointer
pop_back
push_back
push_back
to_string
| ## ◆ operator/=() [1/3] template<typename BasicJsonType >
json_pointer& nlohmann::json_pointer< BasicJsonType >::operator/= | ( | const json_pointer< BasicJsonType > & | ptr | ) |
| inline
  Parameters
  [in] | ptr | JSON pointer to append
  Returns JSON pointer with ptr appended Example The example shows the usage of `operator/=`. 1 #include <iostream> 2 #include <nlohmann/json.hpp> 3 4 using json = nlohmann::json; 5 6 int main() 7 { 8 // create a JSON pointer 9 json::json_pointer ptr("/foo"); 10 std::cout << ptr << '\n'; 11 12 // append a JSON Pointer 13 ptr /= json::json_pointer("/bar/baz"); 14 std::cout << ptr << '\n'; 15 16 // append a string 17 ptr /= "fob"; 18 std::cout << ptr << '\n'; 19 20 // append an array index 21 ptr /= 42; 22 std::cout << ptr << std::endl; 23 } Output (play with this example online):
      "/foo"
      "/foo/bar/baz"
      "/foo/bar/baz/fob"
      "/foo/bar/baz/fob/42"
  The example code above can be translated with
      g++ -std=c++11 -Isingle_include doc/examples/json_pointer__operator_add.cpp -o json_pointer__operator_add
Complexity Linear in the length of ptr. See also operator/=(std::string) to append a reference token operator/=(std::size_t) to append an array index operator/(const json_pointer&, const json_pointer&) for a binary operator Since version 3.6.0 Definition at line 11128 of file json.hpp.

nlohmann::basic_json::json_pointer
::nlohmann::json_pointer< basic_json > json_pointer
JSON Pointer, see nlohmann::json_pointer.
Definition: json.hpp:16007
nlohmann::json
basic_json<> json
default JSON class
Definition: json.hpp:2774