Commit 25ccf7f9 authored by Niels's avatar Niels

Merge branch 'release/2.0.0'

parents 170b70f0 1c719561
......@@ -35,7 +35,7 @@ There are currently two files which need to be edited:
To run [`re2c`](http://re2c.org) and generate/overwrite file `src/json.hpp` with your changes in file `src/json.hpp.re2c`.
2. [`test/unit.cpp`](https://github.com/nlohmann/json/blob/master/test/unit.cpp) - This contains the [Catch](https://github.com/philsquared/Catch) unit tests which currently cover [100 %](https://coveralls.io/github/nlohmann/json) of the library's code.
2. [`test/src/unit.cpp`](https://github.com/nlohmann/json/blob/master/test/unit.cpp) - This contains the [Catch](https://github.com/philsquared/Catch) unit tests which currently cover [100 %](https://coveralls.io/github/nlohmann/json) of the library's code.
If you add or change a feature, please also add a unit test to this file. The unit tests can be compiled with
......@@ -70,9 +70,6 @@ Please understand that I cannot accept pull requests changing only file `src/jso
The following areas really need contribution:
- Getting the code to compile without errors with the latest **Microsoft Visual Studio** version. I am not using Windows, so I cannot debug code with MSVC myself. There is a job on [AppVeyor](https://ci.appveyor.com/project/nlohmann/json) though.
- Extending the **continuous integration** beyond Linux running some versions of GCC and Clang on [Travis](https://travis-ci.org/nlohmann/json) and Microsoft Visual Studio on [AppVeyor](https://ci.appveyor.com/project/nlohmann/json). We have found a lot of bugs just because several compilers behave in a slightly different manner.
- Extending the **continuous integration** toward more exotic compilers such as Android NDK, Intel's Compiler, or the bleeding-edge versions of GCC or Clang.
- Improving the efficiency of the **JSON parser**. The current parser is implemented as a naive recursive descent parser with hand coded string handling. More sophisticated approaches like LALR parsers would be really appreciated. That said, parser generators like Bison or ANTLR do not play nice with single-header files -- I really would like to keep the parser inside the `json.hpp` header, and I am not aware of approaches similar to [`re2c`](http://re2c.org) for parsing.
- Extending and updating existing **benchmarks** to include (the most recent version of) this library. Though efficiency is not everything, speed and memory consumption are very important characteristics for C++ developers, so having proper comparisons would be interesting.
- Check the code with [**Coverity**](https://scan.coverity.com).
- Make the code **locale-independent**. The library currently only works for a locale where `.` is the decimal point character.
......@@ -14,7 +14,7 @@ There are currently two files which need to be edited:
To run [`re2c`](http://re2c.org) and generate/overwrite file `src/json.hpp` with your changes in file `src/json.hpp.re2c`.
2. [`test/unit.cpp`](https://github.com/nlohmann/json/blob/master/test/unit.cpp) - This contains the [Catch](https://github.com/philsquared/Catch) unit tests which currently cover [100 %](https://coveralls.io/github/nlohmann/json) of the library's code.
2. [`test/src/unit.cpp`](https://github.com/nlohmann/json/blob/master/test/unit.cpp) - This contains the [Catch](https://github.com/philsquared/Catch) unit tests which currently cover [100 %](https://coveralls.io/github/nlohmann/json) of the library's code.
If you add or change a feature, please also add a unit test to this file. The unit tests can be compiled with
......
......@@ -9,3 +9,6 @@ working
html
me.nlohmann.json.docset
android
doc/xml
......@@ -3,6 +3,12 @@ language: cpp
dist: trusty
sudo: required
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "m89SSgE+ASLO38rSKx7MTXK3n5NkP9bIx95jwY71YEiuFzib30PDJ/DifKnXxBjvy/AkCGztErQRk/8ZCvq+4HXozU2knEGnL/RUitvlwbhzfh2D4lmS3BvWBGS3N3NewoPBrRmdcvnT0xjOGXxtZaJ3P74TkB9GBnlz/HmKORA="
# from http://stackoverflow.com/a/32127147/266378
matrix:
include:
......@@ -19,49 +25,146 @@ matrix:
- touch src/json.hpp
- make json_unit CXXFLAGS="-fprofile-arcs -ftest-coverage -std=c++11 -lstdc++" CXX=$COMPILER
- ./json_unit "*"
- coveralls --exclude test/catch.hpp --exclude test/unit.cpp --include src/json.hpp --gcov-options '\-lp' --gcov 'gcov-4.9'
- coveralls --exclude test/src/catch.hpp --exclude test/src/unit.cpp --include src/json.hpp --gcov-options '\-lp' --gcov 'gcov-4.9'
- bash <(curl -s https://codecov.io/bash)
env: COMPILER=g++-4.9
- os: linux
compiler: gcc
before_install: echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'valgrind']
coverity_scan:
project:
name: "nlohmann/json"
description: "Build submitted via Travis CI"
notification_email: niels.lohmann@gmail.com
build_command_prepend: "make clean ; sudo cp $(which g++-5) $(which g++)"
build_command: "make"
branch_pattern: coverity_scan
env: COMPILER=g++-5
- os: linux
compiler: clang
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
packages: ['clang-3.6', 'valgrind']
env: COMPILER=clang++-3.6
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'valgrind']
env: COMPILER=g++-6
# from https://github.com/travis-ci/travis-ci/issues/6120
- os: linux
env:
- LLVM_VERSION=3.8.0
- LLVM_ARCHIVE_PATH=$HOME/clang+llvm.tar.xz
- COMPILER=clang++
- CPPFLAGS="-I $HOME/clang-$LLVM_VERSION/include/c++/v1"
- CXXFLAGS=-lc++
- PATH=$HOME/clang-$LLVM_VERSION/bin:$PATH
- LD_LIBRARY_PATH=$HOME/clang-$LLVM_VERSION/lib:$LD_LIBRARY_PATH
before_install:
- wget http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-14.04.tar.xz -O $LLVM_ARCHIVE_PATH
- mkdir $HOME/clang-$LLVM_VERSION
- tar xf $LLVM_ARCHIVE_PATH -C $HOME/clang-$LLVM_VERSION --strip-components 1
# Clang 3.5 is not able to compile the code,
# see https://travis-ci.org/nlohmann/json/jobs/126720186
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
# packages: ['clang-3.6', 'valgrind']
# env: COMPILER=clang++-3.6
#
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
# packages: ['clang-3.7', 'valgrind']
# env: COMPILER=clang++-3.7
#
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
# packages: ['clang-3.8', 'valgrind']
# env: COMPILER=clang++-3.8
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise']
# packages: ['clang-3.9', 'valgrind']
# env: COMPILER=clang++-3.9
- os: osx
osx_image: beta-xcode6.1
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
packages: ['clang-3.7', 'valgrind']
env: COMPILER=clang++-3.7
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: beta-xcode6.2
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: beta-xcode6.3
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: xcode6.4
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: xcode7.1
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
# - os: osx
# compiler: clang
# env: COMPILER=clang
# before_install:
# - brew update
# - brew install valgrind
- os: osx
osx_image: xcode7.2
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: xcode7.3
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: xcode8
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
script:
- make CXX=$COMPILER CXXFLAGS="-lstdc++"
- uname -a
- $COMPILER --version
- make CXX=$COMPILER
- ./json_unit "*"
- valgrind --error-exitcode=1 --leak-check=full ./json_unit
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/f1196addb0e97a5ff396
on_success: change
on_failure: always
on_start: never
- if [ `which valgrind` ]; then
valgrind --error-exitcode=1 --leak-check=full ./json_unit ;
fi
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)
project(json CXX)
# define the project
project(nlohmann_json VERSION 2.0.0 LANGUAGES CXX)
add_executable(json_unit
src/json.hpp test/catch.hpp test/unit.cpp
)
enable_testing()
if(MSVC)
set(CMAKE_CXX_FLAGS
"/EHsc"
)
option(BuildTests "Build the unit tests" ON)
STRING(REPLACE "/O2" "/Od" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
# define project variables
set(JSON_TARGET_NAME ${PROJECT_NAME})
set(JSON_PACKAGE_NAME ${JSON_TARGET_NAME})
set(JSON_TARGETS_FILENAME "${JSON_PACKAGE_NAME}Targets.cmake")
set(JSON_CONFIG_FILENAME "${JSON_PACKAGE_NAME}Config.cmake")
set(JSON_CONFIGVERSION_FILENAME "${JSON_PACKAGE_NAME}ConfigVersion.cmake")
set(JSON_CONFIG_DESTINATION "cmake")
set(JSON_INCLUDE_DESTINATION "include/nlohmann")
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
else(MSVC)
set(CMAKE_CXX_FLAGS
"-std=c++11"
)
endif(MSVC)
# create and configure the library target
add_library(${JSON_TARGET_NAME} INTERFACE)
target_include_directories(${JSON_TARGET_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${JSON_INCLUDE_DESTINATION}>)
include_directories(
src test
)
# create and configure the unit test target
if (BuildTests)
add_subdirectory(test)
endif()
# generate a config and config version file for the package
include(CMakePackageConfigHelpers)
configure_package_config_file("cmake/config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIG_FILENAME}"
INSTALL_DESTINATION ${JSON_CONFIG_DESTINATION})
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIGVERSION_FILENAME}"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
# export the library target and store build directory in package registry
export(TARGETS ${JSON_TARGET_NAME}
FILE "${CMAKE_CURRENT_BINARY_DIR}/${JSON_TARGETS_FILENAME}")
export(PACKAGE ${JSON_PACKAGE_NAME})
# install library target and config files
install(TARGETS ${JSON_TARGET_NAME}
EXPORT ${JSON_PACKAGE_NAME})
install(FILES "src/json.hpp"
DESTINATION ${JSON_INCLUDE_DESTINATION})
install(EXPORT ${JSON_PACKAGE_NAME}
FILE ${JSON_TARGETS_FILENAME}
DESTINATION ${JSON_CONFIG_DESTINATION})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIG_FILENAME}"
"${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIGVERSION_FILENAME}"
DESTINATION ${JSON_CONFIG_DESTINATION})
......@@ -5,18 +5,52 @@ All notable changes to this project will be documented in this file. This projec
[Full Changelog](https://github.com/nlohmann/json/compare/v1.1.0...HEAD)
- concatenate objects [\#252](https://github.com/nlohmann/json/issues/252)
- Unit test fails when doing a CMake out-of-tree build [\#241](https://github.com/nlohmann/json/issues/241)
- Additional integration options [\#237](https://github.com/nlohmann/json/issues/237)
- Can't use basic\_json::iterator as a base iterator for std::move\_iterator [\#233](https://github.com/nlohmann/json/issues/233)
- Provide a FAQ [\#163](https://github.com/nlohmann/json/issues/163)
- Create PULL\_REQUEST\_TEMPLATE.md [\#213](https://github.com/nlohmann/json/pull/213) ([whackashoe](https://github.com/whackashoe))
- fixed noexcept; added constexpr [\#208](https://github.com/nlohmann/json/pull/208) ([nlohmann](https://github.com/nlohmann))
- Add support for afl-fuzz testing [\#207](https://github.com/nlohmann/json/pull/207) ([mykter](https://github.com/mykter))
- Issue \#178 - Extending support to full uint64\_t/int64\_t range and unsigned type \(updated\) [\#193](https://github.com/nlohmann/json/pull/193) ([twelsby](https://github.com/twelsby))
- json::diff generates incorrect patch when removing multiple array elements. [\#269](https://github.com/nlohmann/json/issues/269)
- -Wconversion warning [\#259](https://github.com/nlohmann/json/issues/259)
- Maybe a bug [\#258](https://github.com/nlohmann/json/issues/258)
- -Wconversion warnings [\#239](https://github.com/nlohmann/json/issues/239)
- ambiguous overload for 'push\_back' and 'operator+=' [\#235](https://github.com/nlohmann/json/issues/235)
- Incorrect dumping of parsed numbers with exponents, but without decimal places [\#230](https://github.com/nlohmann/json/issues/230)
- double values are serialized with commas as decimal points [\#228](https://github.com/nlohmann/json/issues/228)
- Move semantics with std::initializer\_list [\#225](https://github.com/nlohmann/json/issues/225)
- abort during getline in yyfill [\#223](https://github.com/nlohmann/json/issues/223)
- Wrong link in the README.md [\#217](https://github.com/nlohmann/json/issues/217)
- Small bugs in json.hpp \(get\_number\) and unit.cpp \(non-standard integer type test\) [\#199](https://github.com/nlohmann/json/issues/199)
- GCC/clang floating point parsing bug in strtod\(\) [\#195](https://github.com/nlohmann/json/issues/195)
- Bugs in miloyip/nativejson-benchmark: roundtrips [\#187](https://github.com/nlohmann/json/issues/187)
- Floating point exceptions [\#181](https://github.com/nlohmann/json/issues/181)
- In basic\_json::basic\_json\(const CompatibleArrayType& val\), the requirement of CompatibleArrayType is not strict enough. [\#174](https://github.com/nlohmann/json/issues/174)
- Implicit assignment to std::string fails [\#144](https://github.com/nlohmann/json/issues/144)
- Fix Issue \#265 [\#266](https://github.com/nlohmann/json/pull/266) ([06needhamt](https://github.com/06needhamt))
- Issue \#195 - update Travis to Trusty due to gcc/clang strtod\(\) bug [\#196](https://github.com/nlohmann/json/pull/196) ([twelsby](https://github.com/twelsby))
- Compiler Errors With JSON.hpp [\#265](https://github.com/nlohmann/json/issues/265)
- VS2015 compile fail [\#260](https://github.com/nlohmann/json/issues/260)
- Error when using json in g++ [\#254](https://github.com/nlohmann/json/issues/254)
- Update long-term goals [\#246](https://github.com/nlohmann/json/issues/246)
- Error compile Android NDK error: 'strtof' is not a member of 'std' [\#219](https://github.com/nlohmann/json/issues/219)
- Conflicting typedef of ssize\_t on Windows 32 bit when using Boost.Python [\#204](https://github.com/nlohmann/json/issues/204)
- Integer conversion to unsigned [\#178](https://github.com/nlohmann/json/issues/178)
- Define CMake/CTest tests [\#247](https://github.com/nlohmann/json/pull/247) ([robertmrk](https://github.com/robertmrk))
- Out of tree builds and a few other miscellaneous CMake cleanups. [\#242](https://github.com/nlohmann/json/pull/242) ([ChrisKitching](https://github.com/ChrisKitching))
- Implement additional integration options [\#238](https://github.com/nlohmann/json/pull/238) ([robertmrk](https://github.com/robertmrk))
- make serialization locale-independent [\#232](https://github.com/nlohmann/json/pull/232) ([nlohmann](https://github.com/nlohmann))
- fixes \#223 by updating README.md [\#227](https://github.com/nlohmann/json/pull/227) ([kevin--](https://github.com/kevin--))
- Use namespace std for int64\_t and uint64\_t [\#226](https://github.com/nlohmann/json/pull/226) ([lv-zheng](https://github.com/lv-zheng))
- Added missing cerrno header to fix ERANGE compile error on android [\#222](https://github.com/nlohmann/json/pull/222) ([Teemperor](https://github.com/Teemperor))
- Corrected readme [\#218](https://github.com/nlohmann/json/pull/218) ([Annihil](https://github.com/Annihil))
- replaced ssize\_t occurrences with auto \(addresses \#204\) [\#205](https://github.com/nlohmann/json/pull/205) ([nlohmann](https://github.com/nlohmann))
- Fixed issue \#199 - Small bugs in json.hpp \(get\_number\) and unit.cpp \(non-standard integer type test\) [\#200](https://github.com/nlohmann/json/pull/200) ([twelsby](https://github.com/twelsby))
- Fix broken link [\#197](https://github.com/nlohmann/json/pull/197) ([vog](https://github.com/vog))
......
......@@ -10,6 +10,7 @@ all: json_unit
# clean up
clean:
rm -fr json_unit json_benchmarks fuzz fuzz-testing *.dSYM
$(MAKE) clean -Cdoc
##########################################################################
......@@ -19,8 +20,8 @@ clean:
# additional flags
FLAGS = -Wall -Wextra -pedantic -Weffc++ -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch -Wundef -Wno-unused -Wnon-virtual-dtor -Wreorder -Wdeprecated -Wfloat-equal
# build unit tests
json_unit: test/unit.cpp src/json.hpp test/catch.hpp
# build unit tests (TODO: Does this want its own makefile?)
json_unit: test/src/unit.cpp src/json.hpp test/src/catch.hpp
$(CXX) -std=c++11 $(CXXFLAGS) $(FLAGS) $(CPPFLAGS) -I src -I test $< $(LDFLAGS) -o $@
......@@ -30,7 +31,7 @@ json_unit: test/unit.cpp src/json.hpp test/catch.hpp
# compile example files and check output
doctest:
make check_output -C doc
$(MAKE) check_output -C doc
##########################################################################
......@@ -43,11 +44,11 @@ fuzz_testing:
mkdir -p fuzz-testing fuzz-testing/testcases fuzz-testing/out
$(MAKE) fuzz CXX=afl-clang++
mv fuzz fuzz-testing
find test/json_tests -size -5k -name *json | xargs -I{} cp "{}" fuzz-testing/testcases
find test/data/json_tests -size -5k -name *json | xargs -I{} cp "{}" fuzz-testing/testcases
@echo "Execute: afl-fuzz -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzz"
# the fuzzer binary
fuzz: test/fuzz.cpp src/json.hpp
fuzz: test/src/fuzz.cpp src/json.hpp
$(CXX) -std=c++11 $(CXXFLAGS) $(FLAGS) $(CPPFLAGS) -I src $< $(LDFLAGS) -o $@
......@@ -66,7 +67,7 @@ cppcheck:
# create scanner with re2c
re2c: src/json.hpp.re2c
$(RE2C) -b -s -i --no-generation-date $< | $(SED) '1d' > src/json.hpp
$(RE2C) -W --bit-vectors --nested-ifs --no-debug-info $< | $(SED) '1d' > src/json.hpp
# pretty printer
pretty:
......@@ -74,8 +75,8 @@ pretty:
--indent-switches --indent-preproc-block --indent-preproc-define \
--indent-col1-comments --pad-oper --pad-header --align-pointer=type \
--align-reference=type --add-brackets --convert-tabs --close-templates \
--lineend=linux --preserve-date --suffix=none \
src/json.hpp src/json.hpp.re2c test/unit.cpp test/fuzz.cpp benchmarks/benchmarks.cpp doc/examples/*.cpp
--lineend=linux --preserve-date --suffix=none --formatted \
src/json.hpp src/json.hpp.re2c test/src/unit.cpp test/src/fuzz.cpp benchmarks/benchmarks.cpp doc/examples/*.cpp
##########################################################################
......
This diff is collapsed.
......@@ -7,5 +7,4 @@ build_script:
- cmake . -G "Visual Studio 14 2015"
- cmake --build . --config Release
test_script:
- Release\json_unit.exe
- Release\json_unit.exe "*"
- ctest -C Release -V
@PACKAGE_INIT@
cmake_policy(PUSH)
cmake_policy(SET CMP0024 OLD)
include(${CMAKE_CURRENT_LIST_DIR}/@JSON_TARGETS_FILENAME@)
cmake_policy(POP)
\ No newline at end of file
......@@ -236,7 +236,7 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
GENERATE_XML = YES
XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
......
......@@ -2,9 +2,6 @@ SRCDIR = ../src
all: doxygen
clean:
rm -fr me.nlohmann.json.docset html
##########################################################################
# example files
......@@ -44,6 +41,10 @@ create_links: $(EXAMPLES:.cpp=.link)
check_output: $(EXAMPLES:.cpp=.test)
clean:
rm -fr me.nlohmann.json.docset html $(EXAMPLES:.cpp=)
##########################################################################
# Doxygen HTML documentation
##########################################################################
......
<a target="_blank" href="http://melpon.org/wandbox/permlink/fYyscqrsQFtgUePA"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/k5KRwVJ42VggxxzX"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/TTykAqoDgbLzKxt3"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/1fsm4gI55p83DOwU"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/wjOUJUwo2SO7q5u8"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/rsnwWxpDjmtRRSzb"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/7gGtalpuoF4xE7VN"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/aeoZrnhnb3HKClCY"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Sa6XYQS7TJ5sGG8a"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/R7z2SB2rMdFQ9XtR"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/PGQOjyIV7s5YnsQM"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/L1bMeiN6nYm7JrvA"><b>online</b></a>
\ No newline at end of file
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// create a JSON value
json j =
{
{"number", 1}, {"string", "foo"}, {"array", {1, 2}}
};
// read-only access
// output element with JSON pointer "/number"
std::cout << j.at("/number"_json_pointer) << '\n';
// output element with JSON pointer "/string"
std::cout << j.at("/string"_json_pointer) << '\n';
// output element with JSON pointer "/array"
std::cout << j.at("/array"_json_pointer) << '\n';
// output element with JSON pointer "/array/1"
std::cout << j.at("/array/1"_json_pointer) << '\n';
// writing access
// change the string
j.at("/string"_json_pointer) = "bar";
// output the changed string
std::cout << j["string"] << '\n';
// change an array element
j.at("/array/1"_json_pointer) = 21;
// output the changed array
std::cout << j["array"] << '\n';
}
<a target="_blank" href="http://melpon.org/wandbox/permlink/NDSjglHZIjIZ0Uxg"><b>online</b></a>
\ No newline at end of file
1
"foo"
[1,2]
2
"bar"
[1,21]
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// create a JSON value
json j =
{
{"number", 1}, {"string", "foo"}, {"array", {1, 2}}
};
// read-only access
// output element with JSON pointer "/number"
std::cout << j.at("/number"_json_pointer) << '\n';
// output element with JSON pointer "/string"
std::cout << j.at("/string"_json_pointer) << '\n';
// output element with JSON pointer "/array"
std::cout << j.at("/array"_json_pointer) << '\n';
// output element with JSON pointer "/array/1"
std::cout << j.at("/array/1"_json_pointer) << '\n';
}
<a target="_blank" href="http://melpon.org/wandbox/permlink/OuLYiMJ3pgyOHupb"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/V7lUsd6LyndZDGoM"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/nPVnBcHf8nrNpGOJ"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/mSAAr3GATT6ciVjV"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/dRptmFmhvpsYB49t"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/InYach9gNBDvA8QR"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/MghSilgvyh4ZJShY"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/VDu3HkQPf0Rv5dzH"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/PcMzhcu2RpD7KSwr"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/BjDrTHvJMwFC3iLr"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/2TCYWSrOxnR05AZI"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ZJz4SFD4Iuy8OS4T"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/JzLCMcSXNsh4uVWa"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Fe1WNG7eJRaWYMM4"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/b9hbCY8zfOiTOuoK"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Ulv0RYN6QoJ6ECVR"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/nKF1QcieoCHm6Lez"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/T5FlYwVpQ1oXBuBH"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/dTbSNAvl6TqrMEAn"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/vPBv5smAPKUko4Qo"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/6Qfn12BDzb3vqO5p"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/saCwetmQZaB8tQ24"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/VmVl9pyrQp8LyOnU"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/BzGFT02b2KTR6z2B"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/3xQ1qy7BT9OrSSCo"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Ib1A0jrFXwYhf0eA"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/iWYvmlA4qQmtvACX"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/lUltfC5TlmxeUq5X"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/VzSqLszbnoWE92dD"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/r7SIosyJCePZZvqh"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/iZzzxEpB7tbhz0cx"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/y7ngrkT74SN0fFWG"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/CaDlatv1uXhQiu7o"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Y7B27Mtrcp64PI9l"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/PMMpoM0ujdJDsuta"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/rsIsQEvaeJEaJx9c"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/OTgOxjIAKFvxpFdm"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/3aV9OONj8OfHPXBV"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/cCQRCvjXdRM9YpT5"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/YhDZ1WhldMdwBthI"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/DgtHcz5L6JphTOGJ"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/OTJ7W8jL7z9qQlkL"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/IFZT4VL0oRotJBxl"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ZRv2SsnLGdLzBhFO"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/cwNYP1q2mT8CFLTk"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/xttjHgaxVqpfriXz"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/AtV4zVErfLwkileg"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ejZBeBBPEBmYsPFz"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/qdV5W2Lrljmjv4LG"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/fkrZveuulCw95PXF"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/RMpEI2o935KgD2o2"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/9HE53y23Ldu1xzQU"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/0lW1WJ1ZP8g92Jp9"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/8rGgyscFrA1fCiIn"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/yarD6DyxYlIf8Ymg"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Zek4QM4kvKLUywGC"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/9oPbpnFNgKtKjB0O"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/D6RJMyjkibQmKUC4"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/wwsjMZP8U6bWhUil"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/GFOaqTzQCZeTQk3R"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/XoXqF9LlWu8jlNgE"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ZVFFzaSjRzx81O7o"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/GQz9A5y7HduQHVMw"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/EmWt4iCaVbSmTxUs"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Qom888gs2RM4wR4H"><b>online</b></a>
\ No newline at end of file
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// the source document
json source = R"(
{
"baz": "qux",
"foo": "bar"
}
)"_json;
// the target document
json target = R"(
{
"baz": "boo",
"hello": [
"world"
]
}
)"_json;
// create the patch
json patch = json::diff(source, target);
// roundtrip
json patched_source = source.patch(patch);
// output patch and roundtrip result
std::cout << std::setw(4) << patch << "\n\n"
<< std::setw(4) << patched_source << std::endl;
}
<a target="_blank" href="http://melpon.org/wandbox/permlink/hicmeOK39tBxaluM"><b>online</b></a>
\ No newline at end of file
[
{
"op": "replace",
"path": "/baz",
"value": "boo"
},
{
"op": "remove",
"path": "/foo"
},
{
"op": "add",
"path": "/hello",
"value": [
"world"
]
}
]
{
"baz": "boo",
"hello": [
"world"
]
}
<a target="_blank" href="http://melpon.org/wandbox/permlink/PjtHNsrmmgEeCFVp"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/rjYfsEq7v1RCHprk"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/daiGc21CilMsU7ln"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/rP64u8KqUJqB9lFd"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/7QIAVTX9fvOkHUrH"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/4Fbmy4IG012HmGKs"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/DlwzEWGJkvmikaNi"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/W83LsQNBy5qCoABq"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ds4TH3IAYVLCGyIz"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/zGMngigiwwhsXEhB"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/h6FfQqA0UIqdG6ca"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/0eXbiM5KTPPXFkyP"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Fg7ut6CV4YBCsDbQ"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/WXGKRKjzP22ggTEr"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/BfABW7AMVl4xqeoJ"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Kk6nOpsa6KetydpZ"><b>online</b></a>
\ No newline at end of file
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON value
json j =
{
{"pi", 3.141},
{"happy", true},
{"name", "Niels"},
{"nothing", nullptr},
{
"answer", {
{"everything", 42}
}
},
{"list", {1, 0, 2}},
{
"object", {
{"currency", "USD"},
{"value", 42.99}
}
}
};
// call flatten()
std::cout << std::setw(4) << j.flatten() << '\n';
}
<a target="_blank" href="http://melpon.org/wandbox/permlink/cdQa6jE0N2LyqFJe"><b>online</b></a>
\ No newline at end of file
{
"/answer/everything": 42,
"/happy": true,
"/list/0": 1,
"/list/1": 0,
"/list/2": 2,
"/name": "Niels",
"/nothing": null,
"/object/currency": "USD",
"/object/value": 42.99,
"/pi": 3.141
}
<a target="_blank" href="http://melpon.org/wandbox/permlink/HheeceJWHngZFhu2"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/CUpMCzt6D9v3cYGM"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/iunIxpTIIy6vcWJZ"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/TRkhQoCdScWQqi3x"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/7k9830oUxfGndWzT"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ksZAkIKQnYhJKLpN"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/NDeUS78poIDrGhIP"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/xYbUV0BmOfNtQcED"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/5IINd4ZXCINhlk8u"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/WiO1oBWDvIs82OX1"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/814P5z0lA90nVh8b"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ePN9gb4P3WTAiT6H"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/OG3x3F7DFoqtHyqh"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/wnxritIWxpGS2SSt"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/6gMuEfviD6ijflgd"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/kem0JnkdOVLNHii5"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/pUKVc892loGnjxUL"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/rub1CDmN5dKK1LJW"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/0jJBJgku6NLIxJfv"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/hGGh0jnNmRo7bYAZ"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/chWkSIROaePvwcDq"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/tWBJHygekWKqZIqe"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/j10gcmatdR8o625C"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/USx0486t9Qxi5LS3"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/rnEIZwD2AvtjaEzo"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/d75Hu1c8QVdDtabd"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ZyMWRbD7gH5eC5Xy"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/97mIrpY9h1rodAfI"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ouIIgi0X3Te9upBj"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/AHeVLaVJlG3cIehg"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/jZwJVIXretvfg4kS"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/WRiD854M5bTtQTnw"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Vd3c1gtskokcJHp7"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/BYzDklHPHDZA2CXX"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ivLUeazmkk6aCUkE"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/TW8VagDAhVeaItcp"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/9qjfclmdmZrCnVR3"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/A0B17yXywuT7Z1gx"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/Uh60XVyyG1N5pL2n"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/ePqrJBez1pH5dC7V"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/QH2PmyggbFbaA8Dg"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/46XRsxj3NvcwTpAZ"><b>online</b></a>
\ No newline at end of file
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// correct JSON pointers
json::json_pointer p1;
json::json_pointer p2("");
json::json_pointer p3("/");
json::json_pointer p4("//");
json::json_pointer p5("/foo/bar");
json::json_pointer p6("/foo/bar/-");
json::json_pointer p7("/foo/~0");
json::json_pointer p8("/foo/~1");
// error: JSON pointer does not begin with a slash
try
{
json::json_pointer p9("foo");
}
catch (std::domain_error& e)
{
std::cout << "domain_error: " << e.what() << '\n';
}
// error: JSON pointer uses escape symbol ~ not followed by 0 or 1
try
{
json::json_pointer p10("/foo/~");
}
catch (std::domain_error& e)
{
std::cout << "domain_error: " << e.what() << '\n';
}
// error: JSON pointer uses escape symbol ~ not followed by 0 or 1
try
{
json::json_pointer p11("/foo/~3");
}
catch (std::domain_error& e)
{
std::cout << "domain_error: " << e.what() << '\n';
}
}
<a target="_blank" href="http://melpon.org/wandbox/permlink/WM2WWKnXdmdw17Wu"><b>online</b></a>
\ No newline at end of file
domain_error: JSON pointer must be empty or begin with '/'
domain_error: escape error: '~' must be followed with '0' or '1'
domain_error: escape error: '~' must be followed with '0' or '1'
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// different JSON Pointers
json::json_pointer ptr1("");
json::json_pointer ptr2("/foo");
json::json_pointer ptr3("/foo/0");
json::json_pointer ptr4("/");
json::json_pointer ptr5("/a~1b");
json::json_pointer ptr6("/c%d");
json::json_pointer ptr7("/e^f");
json::json_pointer ptr8("/g|h");
json::json_pointer ptr9("/i\\j");
json::json_pointer ptr10("/k\"l");
json::json_pointer ptr11("/ ");
json::json_pointer ptr12("/m~0n");
std::cout << ptr1.to_string() << '\n'
<< ptr2.to_string() << '\n'
<< ptr3.to_string() << '\n'
<< ptr4.to_string() << '\n'
<< ptr5.to_string() << '\n'
<< ptr6.to_string() << '\n'
<< ptr7.to_string() << '\n'
<< ptr8.to_string() << '\n'
<< ptr9.to_string() << '\n'
<< ptr10.to_string() << '\n'
<< ptr11.to_string() << '\n'
<< ptr12.to_string() << std::endl;
}
<a target="_blank" href="http://melpon.org/wandbox/permlink/O4FbKx0TbZioFhfU"><b>online</b></a>
\ No newline at end of file
/foo
/foo/0
/
/a~1b
/c%d
/e^f
/g|h
/i\j
/k"l
/
/m~0n
<a target="_blank" href="http://melpon.org/wandbox/permlink/pHK8lxPJaR0LZwRM"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/NBFk3TxTo32pKt36"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/g46YJ0TCAELXYvZb"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/hhxRaUctq3FA54SW"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/laFGVm1oHwhEIiJl"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/rUGX6AaVuZfwiiYI"><b>online</b></a>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment