JSON for Modern C++ 2.1.1
Loading...
Searching...
No Matches

◆ operator std::string()

template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer>
nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_pointer::operator std::string ( ) const
inline
Invariant
For each JSON pointer ptr, it holds:
ptr == json_pointer(ptr.to_string());
Returns
a string representation of the JSON pointer
Example\n The example shows the result of to_string. \n @includelineno
json_pointer__to_string.cpp
Output (play with this example online):
/foo
/foo/0
/
/a~1b
/c%d
/e^f
/g|h
/i\j
/k"l
/ 
/m~0n

The example code above can be translated with
g++ -std=c++11 -Isrc doc/examples/
json_pointer__to_string.cpp -o 
json_pointer__to_string 
Since
version 2.0.0

Definition at line 11161 of file json.hpp.