mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-06 00:31:10 +01:00
Merge pull request #1101 from open-source-parsers/drop_cpptl_support
Issue 1100: Drop CPPTL support
This commit is contained in:
commit
cfc3e927fc
@ -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 CPPTL_JSON_ALLOCATOR_H_INCLUDED
|
#ifndef JSON_ALLOCATOR_H_INCLUDED
|
||||||
#define CPPTL_JSON_ALLOCATOR_H_INCLUDED
|
#define JSON_ALLOCATOR_H_INCLUDED
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -86,4 +86,4 @@ bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
|
|||||||
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
#endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED
|
#endif // JSON_ALLOCATOR_H_INCLUDED
|
||||||
|
@ -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 CPPTL_JSON_ASSERTIONS_H_INCLUDED
|
#ifndef JSON_ASSERTIONS_H_INCLUDED
|
||||||
#define CPPTL_JSON_ASSERTIONS_H_INCLUDED
|
#define JSON_ASSERTIONS_H_INCLUDED
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -56,4 +56,4 @@
|
|||||||
JSON_FAIL_MESSAGE(message); \
|
JSON_FAIL_MESSAGE(message); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
|
#endif // JSON_ASSERTIONS_H_INCLUDED
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
|
|
||||||
// Distributed under MIT license, or public domain if desired and
|
|
||||||
// recognized in your jurisdiction.
|
|
||||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
|
||||||
|
|
||||||
#ifndef JSON_AUTOLINK_H_INCLUDED
|
|
||||||
#define JSON_AUTOLINK_H_INCLUDED
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#ifdef JSON_IN_CPPTL
|
|
||||||
#include <cpptl/cpptl_autolink.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \
|
|
||||||
!defined(JSON_IN_CPPTL)
|
|
||||||
#define CPPTL_AUTOLINK_NAME "json"
|
|
||||||
#undef CPPTL_AUTOLINK_DLL
|
|
||||||
#ifdef JSON_DLL
|
|
||||||
#define CPPTL_AUTOLINK_DLL
|
|
||||||
#endif
|
|
||||||
#include "autolink.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // JSON_AUTOLINK_H_INCLUDED
|
|
@ -14,16 +14,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
/// If defined, indicates that json library is embedded in CppTL library.
|
|
||||||
//# define JSON_IN_CPPTL 1
|
|
||||||
|
|
||||||
/// If defined, indicates that json may leverage CppTL library
|
|
||||||
//# define JSON_USE_CPPTL 1
|
|
||||||
/// If defined, indicates that cpptl vector based map should be used instead of
|
|
||||||
/// std::map
|
|
||||||
/// as Value container.
|
|
||||||
//# define JSON_USE_CPPTL_SMALLMAP 1
|
|
||||||
|
|
||||||
// If non-zero, the library uses exceptions to report bad input instead of C
|
// If non-zero, the library uses exceptions to report bad input instead of C
|
||||||
// assertion macros. The default is to use exceptions.
|
// assertion macros. The default is to use exceptions.
|
||||||
#ifndef JSON_USE_EXCEPTION
|
#ifndef JSON_USE_EXCEPTION
|
||||||
@ -40,28 +30,22 @@
|
|||||||
/// Remarks: it is automatically defined in the generated amalgamated header.
|
/// Remarks: it is automatically defined in the generated amalgamated header.
|
||||||
// #define JSON_IS_AMALGAMATION
|
// #define JSON_IS_AMALGAMATION
|
||||||
|
|
||||||
#ifdef JSON_IN_CPPTL
|
// Export macros for DLL visibility
|
||||||
#include <cpptl/config.h>
|
#if defined(JSON_DLL_BUILD)
|
||||||
#ifndef JSON_USE_CPPTL
|
|
||||||
#define JSON_USE_CPPTL 1
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef JSON_IN_CPPTL
|
|
||||||
#define JSON_API CPPTL_API
|
|
||||||
#elif defined(JSON_DLL_BUILD)
|
|
||||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||||
#define JSON_API __declspec(dllexport)
|
#define JSON_API __declspec(dllexport)
|
||||||
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
|
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
#define JSON_API __attribute__((visibility("default")))
|
#define JSON_API __attribute__((visibility("default")))
|
||||||
#endif // if defined(_MSC_VER)
|
#endif // if defined(_MSC_VER)
|
||||||
|
|
||||||
#elif defined(JSON_DLL)
|
#elif defined(JSON_DLL)
|
||||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||||
#define JSON_API __declspec(dllimport)
|
#define JSON_API __declspec(dllimport)
|
||||||
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
|
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
|
||||||
#endif // if defined(_MSC_VER)
|
#endif // if defined(_MSC_VER)
|
||||||
#endif // ifdef JSON_IN_CPPTL
|
#endif // ifdef JSON_DLL_BUILD
|
||||||
|
|
||||||
#if !defined(JSON_API)
|
#if !defined(JSON_API)
|
||||||
#define JSON_API
|
#define JSON_API
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#ifndef JSON_JSON_H_INCLUDED
|
#ifndef JSON_JSON_H_INCLUDED
|
||||||
#define JSON_JSON_H_INCLUDED
|
#define JSON_JSON_H_INCLUDED
|
||||||
|
|
||||||
#include "autolink.h"
|
#include "config.h"
|
||||||
#include "json_features.h"
|
#include "json_features.h"
|
||||||
#include "reader.h"
|
#include "reader.h"
|
||||||
#include "value.h"
|
#include "value.h"
|
||||||
|
@ -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 CPPTL_JSON_FEATURES_H_INCLUDED
|
#ifndef JSON_FEATURES_H_INCLUDED
|
||||||
#define CPPTL_JSON_FEATURES_H_INCLUDED
|
#define JSON_FEATURES_H_INCLUDED
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGAMATION)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
#include "forwards.h"
|
#include "forwards.h"
|
||||||
@ -64,4 +64,4 @@ public:
|
|||||||
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
#endif // CPPTL_JSON_FEATURES_H_INCLUDED
|
#endif // JSON_FEATURES_H_INCLUDED
|
||||||
|
@ -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 CPPTL_JSON_READER_H_INCLUDED
|
#ifndef JSON_READER_H_INCLUDED
|
||||||
#define CPPTL_JSON_READER_H_INCLUDED
|
#define JSON_READER_H_INCLUDED
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGAMATION)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
#include "json_features.h"
|
#include "json_features.h"
|
||||||
@ -400,4 +400,4 @@ JSON_API IStream& operator>>(IStream&, Value&);
|
|||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
|
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
|
||||||
|
|
||||||
#endif // CPPTL_JSON_READER_H_INCLUDED
|
#endif // JSON_READER_H_INCLUDED
|
||||||
|
@ -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 CPPTL_JSON_H_INCLUDED
|
#ifndef JSON_H_INCLUDED
|
||||||
#define CPPTL_JSON_H_INCLUDED
|
#define JSON_H_INCLUDED
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGAMATION)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
#include "forwards.h"
|
#include "forwards.h"
|
||||||
@ -23,19 +23,11 @@
|
|||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifndef JSON_USE_CPPTL_SMALLMAP
|
|
||||||
#include <map>
|
|
||||||
#else
|
|
||||||
#include <cpptl/smallmap.h>
|
|
||||||
#endif
|
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
#include <cpptl/forwards.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
|
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
|
||||||
// be used by...
|
// be used by...
|
||||||
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
|
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
|
||||||
@ -120,11 +112,6 @@ enum PrecisionType {
|
|||||||
decimalPlaces ///< we set max number of digits after "." in string
|
decimalPlaces ///< we set max number of digits after "." in string
|
||||||
};
|
};
|
||||||
|
|
||||||
//# ifdef JSON_USE_CPPTL
|
|
||||||
// typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
|
|
||||||
// typedef CppTL::AnyEnumerator<const Value &> EnumValues;
|
|
||||||
//# endif
|
|
||||||
|
|
||||||
/** \brief Lightweight wrapper to tag static string.
|
/** \brief Lightweight wrapper to tag static string.
|
||||||
*
|
*
|
||||||
* Value constructor and objectValue member assignment takes advantage of the
|
* Value constructor and objectValue member assignment takes advantage of the
|
||||||
@ -287,11 +274,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifndef JSON_USE_CPPTL_SMALLMAP
|
|
||||||
typedef std::map<CZString, Value> ObjectValues;
|
typedef std::map<CZString, Value> ObjectValues;
|
||||||
#else
|
|
||||||
typedef CppTL::SmallMap<CZString, Value> ObjectValues;
|
|
||||||
#endif // ifndef JSON_USE_CPPTL_SMALLMAP
|
|
||||||
#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
|
#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -340,9 +323,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
Value(const StaticString& value);
|
Value(const StaticString& value);
|
||||||
Value(const String& value);
|
Value(const String& value);
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
Value(const CppTL::ConstString& value);
|
|
||||||
#endif
|
|
||||||
Value(bool value);
|
Value(bool value);
|
||||||
Value(const Value& other);
|
Value(const Value& other);
|
||||||
Value(Value&& other);
|
Value(Value&& other);
|
||||||
@ -384,9 +364,6 @@ public:
|
|||||||
* \return false if !string. (Seg-fault if str or end are NULL.)
|
* \return false if !string. (Seg-fault if str or end are NULL.)
|
||||||
*/
|
*/
|
||||||
bool getString(char const** begin, char const** end) const;
|
bool getString(char const** begin, char const** end) const;
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
CppTL::ConstString asConstString() const;
|
|
||||||
#endif
|
|
||||||
Int asInt() const;
|
Int asInt() const;
|
||||||
UInt asUInt() const;
|
UInt asUInt() const;
|
||||||
#if defined(JSON_HAS_INT64)
|
#if defined(JSON_HAS_INT64)
|
||||||
@ -498,13 +475,6 @@ public:
|
|||||||
* \endcode
|
* \endcode
|
||||||
*/
|
*/
|
||||||
Value& operator[](const StaticString& key);
|
Value& operator[](const StaticString& key);
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
/// Access an object value by name, create a null member if it does not exist.
|
|
||||||
Value& operator[](const CppTL::ConstString& key);
|
|
||||||
/// Access an object value by name, returns null if there is no member with
|
|
||||||
/// that name.
|
|
||||||
const Value& operator[](const CppTL::ConstString& key) const;
|
|
||||||
#endif
|
|
||||||
/// Return the member named key if it exist, defaultValue otherwise.
|
/// Return the member named key if it exist, defaultValue otherwise.
|
||||||
/// \note deep copy
|
/// \note deep copy
|
||||||
Value get(const char* key, const Value& defaultValue) const;
|
Value get(const char* key, const Value& defaultValue) const;
|
||||||
@ -517,11 +487,6 @@ public:
|
|||||||
/// \note deep copy
|
/// \note deep copy
|
||||||
/// \param key may contain embedded nulls.
|
/// \param key may contain embedded nulls.
|
||||||
Value get(const String& key, const Value& defaultValue) const;
|
Value get(const String& key, const Value& defaultValue) const;
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
/// Return the member named key if it exist, defaultValue otherwise.
|
|
||||||
/// \note deep copy
|
|
||||||
Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
|
|
||||||
#endif
|
|
||||||
/// Most general and efficient version of isMember()const, get()const,
|
/// Most general and efficient version of isMember()const, get()const,
|
||||||
/// 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
|
||||||
@ -567,10 +532,6 @@ public:
|
|||||||
bool isMember(const String& key) const;
|
bool isMember(const String& key) const;
|
||||||
/// Same as isMember(String const& key)const
|
/// Same as isMember(String const& key)const
|
||||||
bool isMember(const char* begin, const char* end) const;
|
bool isMember(const char* begin, const char* end) const;
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
/// Return true if the object has a member named key.
|
|
||||||
bool isMember(const CppTL::ConstString& key) const;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// \brief Return a list of the member names.
|
/// \brief Return a list of the member names.
|
||||||
///
|
///
|
||||||
@ -579,11 +540,6 @@ public:
|
|||||||
/// \post if type() was nullValue, it remains nullValue
|
/// \post if type() was nullValue, it remains nullValue
|
||||||
Members getMemberNames() const;
|
Members getMemberNames() const;
|
||||||
|
|
||||||
//# ifdef JSON_USE_CPPTL
|
|
||||||
// EnumMemberNames enumMemberNames() const;
|
|
||||||
// EnumValues enumValues() const;
|
|
||||||
//# endif
|
|
||||||
|
|
||||||
/// \deprecated Always pass len.
|
/// \deprecated Always pass len.
|
||||||
JSONCPP_DEPRECATED("Use setComment(String const&) instead.")
|
JSONCPP_DEPRECATED("Use setComment(String const&) instead.")
|
||||||
void setComment(const char* comment, CommentPlacement placement) {
|
void setComment(const char* comment, CommentPlacement placement) {
|
||||||
@ -706,11 +662,6 @@ template <> inline float Value::as<float>() const { return asFloat(); }
|
|||||||
template <> inline const char* Value::as<const char*>() const {
|
template <> inline const char* Value::as<const char*>() const {
|
||||||
return asCString();
|
return asCString();
|
||||||
}
|
}
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
template <> inline CppTL::ConstString Value::as<CppTL::ConstString>() const {
|
|
||||||
return asConstString();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** \brief Experimental and untested: represents an element of the "path" to
|
/** \brief Experimental and untested: represents an element of the "path" to
|
||||||
* access a node.
|
* access a node.
|
||||||
@ -960,4 +911,4 @@ inline void swap(Value& a, Value& b) { a.swap(b); }
|
|||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
|
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
|
||||||
|
|
||||||
#endif // CPPTL_JSON_H_INCLUDED
|
#endif // JSON_H_INCLUDED
|
||||||
|
@ -21,7 +21,6 @@ project(
|
|||||||
jsoncpp_headers = [
|
jsoncpp_headers = [
|
||||||
'include/json/allocator.h',
|
'include/json/allocator.h',
|
||||||
'include/json/assertions.h',
|
'include/json/assertions.h',
|
||||||
'include/json/autolink.h',
|
|
||||||
'include/json/config.h',
|
'include/json/config.h',
|
||||||
'include/json/json_features.h',
|
'include/json/json_features.h',
|
||||||
'include/json/forwards.h',
|
'include/json/forwards.h',
|
||||||
|
@ -8,16 +8,13 @@
|
|||||||
#include <json/value.h>
|
#include <json/value.h>
|
||||||
#include <json/writer.h>
|
#include <json/writer.h>
|
||||||
#endif // if !defined(JSON_IS_AMALGAMATION)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <cstddef>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
#include <cpptl/conststring.h>
|
|
||||||
#endif
|
|
||||||
#include <algorithm> // min()
|
|
||||||
#include <cstddef> // size_t
|
|
||||||
|
|
||||||
// Provide implementation equivalent of std::snprintf for older _MSC compilers
|
// Provide implementation equivalent of std::snprintf for older _MSC compilers
|
||||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||||
@ -419,14 +416,6 @@ Value::Value(const StaticString& value) {
|
|||||||
value_.string_ = const_cast<char*>(value.c_str());
|
value_.string_ = const_cast<char*>(value.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
Value::Value(const CppTL::ConstString& value) {
|
|
||||||
initBasic(stringValue, true);
|
|
||||||
value_.string_ = duplicateAndPrefixStringValue(
|
|
||||||
value, static_cast<unsigned>(value.length()));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Value::Value(bool value) {
|
Value::Value(bool value) {
|
||||||
initBasic(booleanValue);
|
initBasic(booleanValue);
|
||||||
value_.bool_ = value;
|
value_.bool_ = value;
|
||||||
@ -654,15 +643,6 @@ String Value::asString() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
CppTL::ConstString Value::asConstString() const {
|
|
||||||
unsigned len;
|
|
||||||
char const* str;
|
|
||||||
decodePrefixedString(isAllocated(), value_.string_, &len, &str);
|
|
||||||
return CppTL::ConstString(str, len);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Value::Int Value::asInt() const {
|
Value::Int Value::asInt() const {
|
||||||
switch (type()) {
|
switch (type()) {
|
||||||
case intValue:
|
case intValue:
|
||||||
@ -1135,18 +1115,6 @@ Value& Value::operator[](const StaticString& key) {
|
|||||||
return resolveReference(key.c_str());
|
return resolveReference(key.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
Value& Value::operator[](const CppTL::ConstString& key) {
|
|
||||||
return resolveReference(key.c_str(), key.end_c_str());
|
|
||||||
}
|
|
||||||
Value const& Value::operator[](CppTL::ConstString const& key) const {
|
|
||||||
Value const* found = find(key.c_str(), key.end_c_str());
|
|
||||||
if (!found)
|
|
||||||
return nullSingleton();
|
|
||||||
return *found;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Value& Value::append(const Value& value) { return append(Value(value)); }
|
Value& Value::append(const Value& value) { return append(Value(value)); }
|
||||||
|
|
||||||
Value& Value::append(Value&& value) {
|
Value& Value::append(Value&& value) {
|
||||||
@ -1240,13 +1208,6 @@ bool Value::removeIndex(ArrayIndex index, Value* removed) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
Value Value::get(const CppTL::ConstString& key,
|
|
||||||
const Value& defaultValue) const {
|
|
||||||
return get(key.c_str(), key.end_c_str(), defaultValue);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool Value::isMember(char const* begin, char const* end) const {
|
bool Value::isMember(char const* begin, char const* end) const {
|
||||||
Value const* value = find(begin, end);
|
Value const* value = find(begin, end);
|
||||||
return nullptr != value;
|
return nullptr != value;
|
||||||
@ -1258,12 +1219,6 @@ bool Value::isMember(String const& key) const {
|
|||||||
return isMember(key.data(), key.data() + key.length());
|
return isMember(key.data(), key.data() + key.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
bool Value::isMember(const CppTL::ConstString& key) const {
|
|
||||||
return isMember(key.c_str(), key.end_c_str());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Value::Members Value::getMemberNames() const {
|
Value::Members Value::getMemberNames() const {
|
||||||
JSON_ASSERT_MESSAGE(
|
JSON_ASSERT_MESSAGE(
|
||||||
type() == nullValue || type() == objectValue,
|
type() == nullValue || type() == objectValue,
|
||||||
@ -1279,31 +1234,6 @@ Value::Members Value::getMemberNames() const {
|
|||||||
}
|
}
|
||||||
return members;
|
return members;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
//# ifdef JSON_USE_CPPTL
|
|
||||||
// EnumMemberNames
|
|
||||||
// Value::enumMemberNames() const
|
|
||||||
//{
|
|
||||||
// if ( type() == objectValue )
|
|
||||||
// {
|
|
||||||
// return CppTL::Enum::any( CppTL::Enum::transform(
|
|
||||||
// CppTL::Enum::keys( *(value_.map_), CppTL::Type<const CZString &>() ),
|
|
||||||
// MemberNamesTransform() ) );
|
|
||||||
// }
|
|
||||||
// return EnumMemberNames();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// EnumValues
|
|
||||||
// Value::enumValues() const
|
|
||||||
//{
|
|
||||||
// if ( type() == objectValue || type() == arrayValue )
|
|
||||||
// return CppTL::Enum::anyValues( *(value_.map_),
|
|
||||||
// CppTL::Type<const Value &>() );
|
|
||||||
// return EnumValues();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//# endif
|
|
||||||
|
|
||||||
static bool IsIntegral(double d) {
|
static bool IsIntegral(double d) {
|
||||||
double integral_part;
|
double integral_part;
|
||||||
|
@ -30,9 +30,6 @@ void ValueIteratorBase::decrement() { --current_; }
|
|||||||
|
|
||||||
ValueIteratorBase::difference_type
|
ValueIteratorBase::difference_type
|
||||||
ValueIteratorBase::computeDistance(const SelfType& other) const {
|
ValueIteratorBase::computeDistance(const SelfType& other) const {
|
||||||
#ifdef JSON_USE_CPPTL_SMALLMAP
|
|
||||||
return other.current_ - current_;
|
|
||||||
#else
|
|
||||||
// Iterator for null value are initialized using the default
|
// Iterator for null value are initialized using the default
|
||||||
// constructor, which initialize current_ to the default
|
// constructor, which initialize current_ to the default
|
||||||
// std::map::iterator. As begin() and end() are two instance
|
// std::map::iterator. As begin() and end() are two instance
|
||||||
@ -53,7 +50,6 @@ ValueIteratorBase::computeDistance(const SelfType& other) const {
|
|||||||
++myDistance;
|
++myDistance;
|
||||||
}
|
}
|
||||||
return myDistance;
|
return myDistance;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ValueIteratorBase::isEqual(const SelfType& other) const {
|
bool ValueIteratorBase::isEqual(const SelfType& other) const {
|
||||||
|
@ -3584,9 +3584,6 @@ JSONTEST_FIXTURE_LOCAL(MemberTemplateAs, BehavesSameAsNamedAs) {
|
|||||||
const Json::Value jstr = "hello world";
|
const Json::Value jstr = "hello world";
|
||||||
JSONTEST_ASSERT_STRING_EQUAL(jstr.as<const char*>(), jstr.asCString());
|
JSONTEST_ASSERT_STRING_EQUAL(jstr.as<const char*>(), jstr.asCString());
|
||||||
JSONTEST_ASSERT_STRING_EQUAL(jstr.as<Json::String>(), jstr.asString());
|
JSONTEST_ASSERT_STRING_EQUAL(jstr.as<Json::String>(), jstr.asString());
|
||||||
#ifdef JSON_USE_CPPTL
|
|
||||||
JSONTEST_ASSERT_STRING_EQUAL(js.as<CppTL::ConstString>(), js.asConstString());
|
|
||||||
#endif
|
|
||||||
EqEval(Json::Int(64), [](const Json::Value& j) { return j.asInt(); });
|
EqEval(Json::Int(64), [](const Json::Value& j) { return j.asInt(); });
|
||||||
EqEval(Json::UInt(64), [](const Json::Value& j) { return j.asUInt(); });
|
EqEval(Json::UInt(64), [](const Json::Value& j) { return j.asUInt(); });
|
||||||
#if defined(JSON_HAS_INT64)
|
#if defined(JSON_HAS_INT64)
|
||||||
|
Loading…
Reference in New Issue
Block a user