mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-07-03 10:17:11 +02:00
Merge branch 'master' into master
This commit is contained in:
commit
cf8a11eab9
@ -62,11 +62,11 @@ project(jsoncpp
|
|||||||
# 2. ./include/json/version.h
|
# 2. ./include/json/version.h
|
||||||
# 3. ./CMakeLists.txt
|
# 3. ./CMakeLists.txt
|
||||||
# IMPORTANT: also update the PROJECT_SOVERSION!!
|
# IMPORTANT: also update the PROJECT_SOVERSION!!
|
||||||
VERSION 1.9.5 # <major>[.<minor>[.<patch>[.<tweak>]]]
|
VERSION 1.9.6 # <major>[.<minor>[.<patch>[.<tweak>]]]
|
||||||
LANGUAGES CXX)
|
LANGUAGES CXX)
|
||||||
|
|
||||||
message(STATUS "JsonCpp Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
message(STATUS "JsonCpp Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||||
set(PROJECT_SOVERSION 25)
|
set(PROJECT_SOVERSION 26)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/include/PreventInSourceBuilds.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/include/PreventInSourceBuilds.cmake)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/include/PreventInBuildInstalls.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/include/PreventInBuildInstalls.cmake)
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
# This function will prevent in-source builds
|
# This function will prevent in-source builds
|
||||||
function(AssureOutOfSourceBuilds)
|
function(AssureOutOfSourceBuilds)
|
||||||
# make sure the user doesn't play dirty with symlinks
|
# make sure the user doesn't play dirty with symlinks
|
||||||
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
|
get_filename_component(srcdir "${CMAKE_CURRENT_SOURCE_DIR}" REALPATH)
|
||||||
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
|
get_filename_component(bindir "${CMAKE_CURRENT_BINARY_DIR}" REALPATH)
|
||||||
|
|
||||||
# disallow in-source builds
|
# disallow in-source builds
|
||||||
if("${srcdir}" STREQUAL "${bindir}")
|
if("${srcdir}" STREQUAL "${bindir}")
|
||||||
|
@ -385,6 +385,12 @@ public:
|
|||||||
* \snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode
|
* \snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode
|
||||||
*/
|
*/
|
||||||
static void strictMode(Json::Value* settings);
|
static void strictMode(Json::Value* settings);
|
||||||
|
/** ECMA-404 mode.
|
||||||
|
* \pre 'settings' != NULL (but Json::null is fine)
|
||||||
|
* \remark Defaults:
|
||||||
|
* \snippet src/lib_json/json_reader.cpp CharReaderBuilderECMA404Mode
|
||||||
|
*/
|
||||||
|
static void ecma404Mode(Json::Value* settings);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Consume entire stream and use its begin/end.
|
/** Consume entire stream and use its begin/end.
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
// recognized in your jurisdiction.
|
// recognized in your jurisdiction.
|
||||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
||||||
|
|
||||||
#ifndef JSON_H_INCLUDED
|
#ifndef JSON_VALUE_H_INCLUDED
|
||||||
#define JSON_H_INCLUDED
|
#define JSON_VALUE_H_INCLUDED
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGAMATION)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
#include "forwards.h"
|
#include "forwards.h"
|
||||||
@ -513,6 +513,9 @@ public:
|
|||||||
/// and operator[]const
|
/// and operator[]const
|
||||||
/// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
|
/// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
|
||||||
Value const* find(char const* begin, char const* end) const;
|
Value const* find(char const* begin, char const* end) const;
|
||||||
|
/// Most general and efficient version of isMember()const, get()const,
|
||||||
|
/// and operator[]const
|
||||||
|
Value const* find(const String& key) const;
|
||||||
/// Most general and efficient version of object-mutators.
|
/// Most general and efficient version of object-mutators.
|
||||||
/// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
|
/// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
|
||||||
/// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue.
|
/// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue.
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
// 3. /CMakeLists.txt
|
// 3. /CMakeLists.txt
|
||||||
// IMPORTANT: also update the SOVERSION!!
|
// IMPORTANT: also update the SOVERSION!!
|
||||||
|
|
||||||
#define JSONCPP_VERSION_STRING "1.9.5"
|
#define JSONCPP_VERSION_STRING "1.9.6"
|
||||||
#define JSONCPP_VERSION_MAJOR 1
|
#define JSONCPP_VERSION_MAJOR 1
|
||||||
#define JSONCPP_VERSION_MINOR 9
|
#define JSONCPP_VERSION_MINOR 9
|
||||||
#define JSONCPP_VERSION_PATCH 5
|
#define JSONCPP_VERSION_PATCH 6
|
||||||
#define JSONCPP_VERSION_QUALIFIER
|
#define JSONCPP_VERSION_QUALIFIER
|
||||||
#define JSONCPP_VERSION_HEXA \
|
#define JSONCPP_VERSION_HEXA \
|
||||||
((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
|
((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
if (TARGET jsoncpp_static)
|
if (NOT TARGET JsonCpp::JsonCpp)
|
||||||
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
|
if (TARGET jsoncpp_static)
|
||||||
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
|
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
|
||||||
elseif (TARGET jsoncpp_lib)
|
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
|
||||||
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
|
elseif (TARGET jsoncpp_lib)
|
||||||
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
|
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
|
||||||
endif ()
|
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
8
jsoncppConfig.cmake.meson.in
Normal file
8
jsoncppConfig.cmake.meson.in
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
@MESON_SHARED_TARGET@
|
||||||
|
@MESON_STATIC_TARGET@
|
||||||
|
|
||||||
|
include ( "${CMAKE_CURRENT_LIST_DIR}/jsoncpp-namespaced-targets.cmake" )
|
||||||
|
|
||||||
|
check_required_components(JsonCpp)
|
43
meson.build
43
meson.build
@ -9,13 +9,13 @@ project(
|
|||||||
# 2. /include/json/version.h
|
# 2. /include/json/version.h
|
||||||
# 3. /CMakeLists.txt
|
# 3. /CMakeLists.txt
|
||||||
# IMPORTANT: also update the SOVERSION!!
|
# IMPORTANT: also update the SOVERSION!!
|
||||||
version : '1.9.4',
|
version : '1.9.6',
|
||||||
default_options : [
|
default_options : [
|
||||||
'buildtype=release',
|
'buildtype=release',
|
||||||
'cpp_std=c++11',
|
'cpp_std=c++11',
|
||||||
'warning_level=1'],
|
'warning_level=1'],
|
||||||
license : 'Public Domain',
|
license : 'Public Domain',
|
||||||
meson_version : '>= 0.49.0')
|
meson_version : '>= 0.54.0')
|
||||||
|
|
||||||
|
|
||||||
jsoncpp_headers = files([
|
jsoncpp_headers = files([
|
||||||
@ -50,7 +50,7 @@ jsoncpp_lib = library(
|
|||||||
'src/lib_json/json_value.cpp',
|
'src/lib_json/json_value.cpp',
|
||||||
'src/lib_json/json_writer.cpp',
|
'src/lib_json/json_writer.cpp',
|
||||||
]),
|
]),
|
||||||
soversion : 25,
|
soversion : 26,
|
||||||
install : true,
|
install : true,
|
||||||
include_directories : jsoncpp_include_directories,
|
include_directories : jsoncpp_include_directories,
|
||||||
cpp_args: dll_export_flag)
|
cpp_args: dll_export_flag)
|
||||||
@ -62,6 +62,43 @@ import('pkgconfig').generate(
|
|||||||
filebase : 'jsoncpp',
|
filebase : 'jsoncpp',
|
||||||
description : 'A C++ library for interacting with JSON')
|
description : 'A C++ library for interacting with JSON')
|
||||||
|
|
||||||
|
cmakeconf = configuration_data()
|
||||||
|
cmakeconf.set('MESON_LIB_DIR', get_option('libdir'))
|
||||||
|
cmakeconf.set('MESON_INCLUDE_DIR', get_option('includedir'))
|
||||||
|
|
||||||
|
fs = import('fs')
|
||||||
|
if get_option('default_library') == 'shared'
|
||||||
|
shared_name = fs.name(jsoncpp_lib.full_path())
|
||||||
|
endif
|
||||||
|
if get_option('default_library') == 'static'
|
||||||
|
static_name = fs.name(jsoncpp_lib.full_path())
|
||||||
|
endif
|
||||||
|
if get_option('default_library') == 'both'
|
||||||
|
shared_name = fs.name(jsoncpp_lib.get_shared_lib().full_path())
|
||||||
|
static_name = fs.name(jsoncpp_lib.get_static_lib().full_path())
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('default_library') == 'shared' or get_option('default_library') == 'both'
|
||||||
|
cmakeconf.set('MESON_SHARED_TARGET', '''
|
||||||
|
add_library(jsoncpp_lib IMPORTED SHARED)
|
||||||
|
set_target_properties(jsoncpp_lib PROPERTIES
|
||||||
|
IMPORTED_LOCATION "''' + join_paths('${PACKAGE_PREFIX_DIR}', get_option('libdir'), shared_name) + '''"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "''' + join_paths('${PACKAGE_PREFIX_DIR}', get_option('includedir')) + '")')
|
||||||
|
endif
|
||||||
|
if get_option('default_library') == 'static' or get_option('default_library') == 'both'
|
||||||
|
cmakeconf.set('MESON_STATIC_TARGET', '''
|
||||||
|
add_library(jsoncpp_static IMPORTED STATIC)
|
||||||
|
set_target_properties(jsoncpp_static PROPERTIES
|
||||||
|
IMPORTED_LOCATION "''' + join_paths('${PACKAGE_PREFIX_DIR}', get_option('libdir'), static_name) + '''"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "''' + join_paths('${PACKAGE_PREFIX_DIR}', get_option('includedir')) + '")')
|
||||||
|
endif
|
||||||
|
|
||||||
|
import('cmake').configure_package_config_file(
|
||||||
|
name: 'jsoncpp',
|
||||||
|
input: 'jsoncppConfig.cmake.meson.in',
|
||||||
|
configuration: cmakeconf)
|
||||||
|
install_data('jsoncpp-namespaced-targets.cmake', install_dir : join_paths(get_option('libdir'), 'cmake', jsoncpp_lib.name()))
|
||||||
|
|
||||||
# for libraries bundling jsoncpp
|
# for libraries bundling jsoncpp
|
||||||
jsoncpp_dep = declare_dependency(
|
jsoncpp_dep = declare_dependency(
|
||||||
include_directories : jsoncpp_include_directories,
|
include_directories : jsoncpp_include_directories,
|
||||||
|
@ -132,7 +132,6 @@ if(BUILD_SHARED_LIBS)
|
|||||||
target_include_directories(${SHARED_LIB} PUBLIC
|
target_include_directories(${SHARED_LIB} PUBLIC
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/${JSONCPP_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/${JSONCPP_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/json>
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CMAKE_TARGETS ${SHARED_LIB})
|
list(APPEND CMAKE_TARGETS ${SHARED_LIB})
|
||||||
@ -166,7 +165,6 @@ if(BUILD_STATIC_LIBS)
|
|||||||
target_include_directories(${STATIC_LIB} PUBLIC
|
target_include_directories(${STATIC_LIB} PUBLIC
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/${JSONCPP_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/${JSONCPP_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/json>
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CMAKE_TARGETS ${STATIC_LIB})
|
list(APPEND CMAKE_TARGETS ${STATIC_LIB})
|
||||||
@ -193,7 +191,6 @@ if(BUILD_OBJECT_LIBS)
|
|||||||
target_include_directories(${OBJECT_LIB} PUBLIC
|
target_include_directories(${OBJECT_LIB} PUBLIC
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/${JSONCPP_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/${JSONCPP_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/json>
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CMAKE_TARGETS ${OBJECT_LIB})
|
list(APPEND CMAKE_TARGETS ${OBJECT_LIB})
|
||||||
|
@ -587,8 +587,7 @@ bool Reader::decodeDouble(Token& token) {
|
|||||||
|
|
||||||
bool Reader::decodeDouble(Token& token, Value& decoded) {
|
bool Reader::decodeDouble(Token& token, Value& decoded) {
|
||||||
double value = 0;
|
double value = 0;
|
||||||
String buffer(token.start_, token.end_);
|
IStringStream is(String(token.start_, token.end_));
|
||||||
IStringStream is(buffer);
|
|
||||||
if (!(is >> value)) {
|
if (!(is >> value)) {
|
||||||
if (value == std::numeric_limits<double>::max())
|
if (value == std::numeric_limits<double>::max())
|
||||||
value = std::numeric_limits<double>::infinity();
|
value = std::numeric_limits<double>::infinity();
|
||||||
@ -1622,8 +1621,7 @@ bool OurReader::decodeDouble(Token& token) {
|
|||||||
|
|
||||||
bool OurReader::decodeDouble(Token& token, Value& decoded) {
|
bool OurReader::decodeDouble(Token& token, Value& decoded) {
|
||||||
double value = 0;
|
double value = 0;
|
||||||
const String buffer(token.start_, token.end_);
|
IStringStream is(String(token.start_, token.end_));
|
||||||
IStringStream is(buffer);
|
|
||||||
if (!(is >> value)) {
|
if (!(is >> value)) {
|
||||||
if (value == std::numeric_limits<double>::max())
|
if (value == std::numeric_limits<double>::max())
|
||||||
value = std::numeric_limits<double>::infinity();
|
value = std::numeric_limits<double>::infinity();
|
||||||
@ -1963,6 +1961,22 @@ void CharReaderBuilder::setDefaults(Json::Value* settings) {
|
|||||||
(*settings)["skipBom"] = true;
|
(*settings)["skipBom"] = true;
|
||||||
//! [CharReaderBuilderDefaults]
|
//! [CharReaderBuilderDefaults]
|
||||||
}
|
}
|
||||||
|
// static
|
||||||
|
void CharReaderBuilder::ecma404Mode(Json::Value* settings) {
|
||||||
|
//! [CharReaderBuilderECMA404Mode]
|
||||||
|
(*settings)["allowComments"] = false;
|
||||||
|
(*settings)["allowTrailingCommas"] = false;
|
||||||
|
(*settings)["strictRoot"] = false;
|
||||||
|
(*settings)["allowDroppedNullPlaceholders"] = false;
|
||||||
|
(*settings)["allowNumericKeys"] = false;
|
||||||
|
(*settings)["allowSingleQuotes"] = false;
|
||||||
|
(*settings)["stackLimit"] = 1000;
|
||||||
|
(*settings)["failIfExtra"] = true;
|
||||||
|
(*settings)["rejectDupKeys"] = false;
|
||||||
|
(*settings)["allowSpecialFloats"] = false;
|
||||||
|
(*settings)["skipBom"] = false;
|
||||||
|
//! [CharReaderBuilderECMA404Mode]
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<CharReader::StructuredError>
|
std::vector<CharReader::StructuredError>
|
||||||
CharReader::getStructuredErrors() const {
|
CharReader::getStructuredErrors() const {
|
||||||
@ -1981,7 +1995,7 @@ bool parseFromStream(CharReader::Factory const& fact, IStream& sin, Value* root,
|
|||||||
String* errs) {
|
String* errs) {
|
||||||
OStringStream ssin;
|
OStringStream ssin;
|
||||||
ssin << sin.rdbuf();
|
ssin << sin.rdbuf();
|
||||||
String doc = ssin.str();
|
String doc = std::move(ssin).str();
|
||||||
char const* begin = doc.data();
|
char const* begin = doc.data();
|
||||||
char const* end = begin + doc.size();
|
char const* end = begin + doc.size();
|
||||||
// Note that we do not actually need a null-terminator.
|
// Note that we do not actually need a null-terminator.
|
||||||
|
@ -1092,6 +1092,9 @@ Value const* Value::find(char const* begin, char const* end) const {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
return &(*it).second;
|
return &(*it).second;
|
||||||
}
|
}
|
||||||
|
Value const* Value::find(const String& key) const {
|
||||||
|
return find(key.data(), key.data() + key.length());
|
||||||
|
}
|
||||||
Value* Value::demand(char const* begin, char const* end) {
|
Value* Value::demand(char const* begin, char const* end) {
|
||||||
JSON_ASSERT_MESSAGE(type() == nullValue || type() == objectValue,
|
JSON_ASSERT_MESSAGE(type() == nullValue || type() == objectValue,
|
||||||
"in Json::Value::demand(begin, end): requires "
|
"in Json::Value::demand(begin, end): requires "
|
||||||
@ -1105,7 +1108,7 @@ const Value& Value::operator[](const char* key) const {
|
|||||||
return *found;
|
return *found;
|
||||||
}
|
}
|
||||||
Value const& Value::operator[](const String& key) const {
|
Value const& Value::operator[](const String& key) const {
|
||||||
Value const* found = find(key.data(), key.data() + key.length());
|
Value const* found = find(key);
|
||||||
if (!found)
|
if (!found)
|
||||||
return nullSingleton();
|
return nullSingleton();
|
||||||
return *found;
|
return *found;
|
||||||
@ -1205,7 +1208,7 @@ bool Value::removeIndex(ArrayIndex index, Value* removed) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (removed)
|
if (removed)
|
||||||
*removed = it->second;
|
*removed = std::move(it->second);
|
||||||
ArrayIndex oldSize = size();
|
ArrayIndex oldSize = size();
|
||||||
// shift left all items left, into the place of the "removed"
|
// shift left all items left, into the place of the "removed"
|
||||||
for (ArrayIndex i = index; i < (oldSize - 1); ++i) {
|
for (ArrayIndex i = index; i < (oldSize - 1); ++i) {
|
||||||
|
@ -1251,7 +1251,7 @@ String writeString(StreamWriter::Factory const& factory, Value const& root) {
|
|||||||
OStringStream sout;
|
OStringStream sout;
|
||||||
StreamWriterPtr const writer(factory.newStreamWriter());
|
StreamWriterPtr const writer(factory.newStreamWriter());
|
||||||
writer->write(root, &sout);
|
writer->write(root, &sout);
|
||||||
return sout.str();
|
return std::move(sout).str();
|
||||||
}
|
}
|
||||||
|
|
||||||
OStream& operator<<(OStream& sout, Value const& root) {
|
OStream& operator<<(OStream& sout, Value const& root) {
|
||||||
|
@ -220,11 +220,20 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, objects) {
|
|||||||
JSONTEST_ASSERT(foundId != nullptr);
|
JSONTEST_ASSERT(foundId != nullptr);
|
||||||
JSONTEST_ASSERT_EQUAL(Json::Value(1234), *foundId);
|
JSONTEST_ASSERT_EQUAL(Json::Value(1234), *foundId);
|
||||||
|
|
||||||
|
const std::string stringIdKey = "id";
|
||||||
|
const Json::Value* stringFoundId = object1_.find(stringIdKey);
|
||||||
|
JSONTEST_ASSERT(stringFoundId != nullptr);
|
||||||
|
JSONTEST_ASSERT_EQUAL(Json::Value(1234), *stringFoundId);
|
||||||
|
|
||||||
const char unknownIdKey[] = "unknown id";
|
const char unknownIdKey[] = "unknown id";
|
||||||
const Json::Value* foundUnknownId =
|
const Json::Value* foundUnknownId =
|
||||||
object1_.find(unknownIdKey, unknownIdKey + strlen(unknownIdKey));
|
object1_.find(unknownIdKey, unknownIdKey + strlen(unknownIdKey));
|
||||||
JSONTEST_ASSERT_EQUAL(nullptr, foundUnknownId);
|
JSONTEST_ASSERT_EQUAL(nullptr, foundUnknownId);
|
||||||
|
|
||||||
|
const std::string stringUnknownIdKey = "unknown id";
|
||||||
|
const Json::Value* stringFoundUnknownId = object1_.find(stringUnknownIdKey);
|
||||||
|
JSONTEST_ASSERT_EQUAL(nullptr, stringFoundUnknownId);
|
||||||
|
|
||||||
// Access through demand()
|
// Access through demand()
|
||||||
const char yetAnotherIdKey[] = "yet another id";
|
const char yetAnotherIdKey[] = "yet another id";
|
||||||
const Json::Value* foundYetAnotherId =
|
const Json::Value* foundYetAnotherId =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user