Skip to content

Commit cfc3e92

Browse files
authored
Merge pull request open-source-parsers#1101 from open-source-parsers/drop_cpptl_support
Issue 1100: Drop CPPTL support
2 parents 781eec4 + a481201 commit cfc3e92

File tree

12 files changed

+24
-192
lines changed

12 files changed

+24
-192
lines changed

include/json/allocator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// recognized in your jurisdiction.
44
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
55

6-
#ifndef CPPTL_JSON_ALLOCATOR_H_INCLUDED
7-
#define CPPTL_JSON_ALLOCATOR_H_INCLUDED
6+
#ifndef JSON_ALLOCATOR_H_INCLUDED
7+
#define JSON_ALLOCATOR_H_INCLUDED
88

99
#include <cstring>
1010
#include <memory>
@@ -86,4 +86,4 @@ bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
8686

8787
#pragma pack(pop)
8888

89-
#endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED
89+
#endif // JSON_ALLOCATOR_H_INCLUDED

include/json/assertions.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// recognized in your jurisdiction.
44
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
55

6-
#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
7-
#define CPPTL_JSON_ASSERTIONS_H_INCLUDED
6+
#ifndef JSON_ASSERTIONS_H_INCLUDED
7+
#define JSON_ASSERTIONS_H_INCLUDED
88

99
#include <cstdlib>
1010
#include <sstream>
@@ -56,4 +56,4 @@
5656
JSON_FAIL_MESSAGE(message); \
5757
}
5858

59-
#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
59+
#endif // JSON_ASSERTIONS_H_INCLUDED

include/json/autolink.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

include/json/config.h

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@
1414
#include <string>
1515
#include <type_traits>
1616

17-
/// If defined, indicates that json library is embedded in CppTL library.
18-
//# define JSON_IN_CPPTL 1
19-
20-
/// If defined, indicates that json may leverage CppTL library
21-
//# define JSON_USE_CPPTL 1
22-
/// If defined, indicates that cpptl vector based map should be used instead of
23-
/// std::map
24-
/// as Value container.
25-
//# define JSON_USE_CPPTL_SMALLMAP 1
26-
2717
// If non-zero, the library uses exceptions to report bad input instead of C
2818
// assertion macros. The default is to use exceptions.
2919
#ifndef JSON_USE_EXCEPTION
@@ -40,28 +30,22 @@
4030
/// Remarks: it is automatically defined in the generated amalgamated header.
4131
// #define JSON_IS_AMALGAMATION
4232

43-
#ifdef JSON_IN_CPPTL
44-
#include <cpptl/config.h>
45-
#ifndef JSON_USE_CPPTL
46-
#define JSON_USE_CPPTL 1
47-
#endif
48-
#endif
49-
50-
#ifdef JSON_IN_CPPTL
51-
#define JSON_API CPPTL_API
52-
#elif defined(JSON_DLL_BUILD)
33+
// Export macros for DLL visibility
34+
#if defined(JSON_DLL_BUILD)
5335
#if defined(_MSC_VER) || defined(__MINGW32__)
5436
#define JSON_API __declspec(dllexport)
5537
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
5638
#elif defined(__GNUC__) || defined(__clang__)
5739
#define JSON_API __attribute__((visibility("default")))
5840
#endif // if defined(_MSC_VER)
41+
5942
#elif defined(JSON_DLL)
6043
#if defined(_MSC_VER) || defined(__MINGW32__)
6144
#define JSON_API __declspec(dllimport)
6245
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
6346
#endif // if defined(_MSC_VER)
64-
#endif // ifdef JSON_IN_CPPTL
47+
#endif // ifdef JSON_DLL_BUILD
48+
6549
#if !defined(JSON_API)
6650
#define JSON_API
6751
#endif

include/json/json.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef JSON_JSON_H_INCLUDED
77
#define JSON_JSON_H_INCLUDED
88

9-
#include "autolink.h"
9+
#include "config.h"
1010
#include "json_features.h"
1111
#include "reader.h"
1212
#include "value.h"

include/json/json_features.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// recognized in your jurisdiction.
44
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
55

6-
#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
7-
#define CPPTL_JSON_FEATURES_H_INCLUDED
6+
#ifndef JSON_FEATURES_H_INCLUDED
7+
#define JSON_FEATURES_H_INCLUDED
88

99
#if !defined(JSON_IS_AMALGAMATION)
1010
#include "forwards.h"
@@ -64,4 +64,4 @@ class JSON_API Features {
6464

6565
#pragma pack(pop)
6666

67-
#endif // CPPTL_JSON_FEATURES_H_INCLUDED
67+
#endif // JSON_FEATURES_H_INCLUDED

include/json/reader.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// recognized in your jurisdiction.
44
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
55

6-
#ifndef CPPTL_JSON_READER_H_INCLUDED
7-
#define CPPTL_JSON_READER_H_INCLUDED
6+
#ifndef JSON_READER_H_INCLUDED
7+
#define JSON_READER_H_INCLUDED
88

99
#if !defined(JSON_IS_AMALGAMATION)
1010
#include "json_features.h"
@@ -400,4 +400,4 @@ JSON_API IStream& operator>>(IStream&, Value&);
400400
#pragma warning(pop)
401401
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
402402

403-
#endif // CPPTL_JSON_READER_H_INCLUDED
403+
#endif // JSON_READER_H_INCLUDED

include/json/value.h

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// recognized in your jurisdiction.
44
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
55

6-
#ifndef CPPTL_JSON_H_INCLUDED
7-
#define CPPTL_JSON_H_INCLUDED
6+
#ifndef JSON_H_INCLUDED
7+
#define JSON_H_INCLUDED
88

99
#if !defined(JSON_IS_AMALGAMATION)
1010
#include "forwards.h"
@@ -23,19 +23,11 @@
2323

2424
#include <array>
2525
#include <exception>
26+
#include <map>
2627
#include <memory>
2728
#include <string>
2829
#include <vector>
2930

30-
#ifndef JSON_USE_CPPTL_SMALLMAP
31-
#include <map>
32-
#else
33-
#include <cpptl/smallmap.h>
34-
#endif
35-
#ifdef JSON_USE_CPPTL
36-
#include <cpptl/forwards.h>
37-
#endif
38-
3931
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
4032
// be used by...
4133
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
@@ -120,11 +112,6 @@ enum PrecisionType {
120112
decimalPlaces ///< we set max number of digits after "." in string
121113
};
122114

123-
//# ifdef JSON_USE_CPPTL
124-
// typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
125-
// typedef CppTL::AnyEnumerator<const Value &> EnumValues;
126-
//# endif
127-
128115
/** \brief Lightweight wrapper to tag static string.
129116
*
130117
* Value constructor and objectValue member assignment takes advantage of the
@@ -287,11 +274,7 @@ class JSON_API Value {
287274
};
288275

289276
public:
290-
#ifndef JSON_USE_CPPTL_SMALLMAP
291277
typedef std::map<CZString, Value> ObjectValues;
292-
#else
293-
typedef CppTL::SmallMap<CZString, Value> ObjectValues;
294-
#endif // ifndef JSON_USE_CPPTL_SMALLMAP
295278
#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
296279

297280
public:
@@ -340,9 +323,6 @@ class JSON_API Value {
340323
*/
341324
Value(const StaticString& value);
342325
Value(const String& value);
343-
#ifdef JSON_USE_CPPTL
344-
Value(const CppTL::ConstString& value);
345-
#endif
346326
Value(bool value);
347327
Value(const Value& other);
348328
Value(Value&& other);
@@ -384,9 +364,6 @@ class JSON_API Value {
384364
* \return false if !string. (Seg-fault if str or end are NULL.)
385365
*/
386366
bool getString(char const** begin, char const** end) const;
387-
#ifdef JSON_USE_CPPTL
388-
CppTL::ConstString asConstString() const;
389-
#endif
390367
Int asInt() const;
391368
UInt asUInt() const;
392369
#if defined(JSON_HAS_INT64)
@@ -498,13 +475,6 @@ class JSON_API Value {
498475
* \endcode
499476
*/
500477
Value& operator[](const StaticString& key);
501-
#ifdef JSON_USE_CPPTL
502-
/// Access an object value by name, create a null member if it does not exist.
503-
Value& operator[](const CppTL::ConstString& key);
504-
/// Access an object value by name, returns null if there is no member with
505-
/// that name.
506-
const Value& operator[](const CppTL::ConstString& key) const;
507-
#endif
508478
/// Return the member named key if it exist, defaultValue otherwise.
509479
/// \note deep copy
510480
Value get(const char* key, const Value& defaultValue) const;
@@ -517,11 +487,6 @@ class JSON_API Value {
517487
/// \note deep copy
518488
/// \param key may contain embedded nulls.
519489
Value get(const String& key, const Value& defaultValue) const;
520-
#ifdef JSON_USE_CPPTL
521-
/// Return the member named key if it exist, defaultValue otherwise.
522-
/// \note deep copy
523-
Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
524-
#endif
525490
/// Most general and efficient version of isMember()const, get()const,
526491
/// and operator[]const
527492
/// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
@@ -567,10 +532,6 @@ class JSON_API Value {
567532
bool isMember(const String& key) const;
568533
/// Same as isMember(String const& key)const
569534
bool isMember(const char* begin, const char* end) const;
570-
#ifdef JSON_USE_CPPTL
571-
/// Return true if the object has a member named key.
572-
bool isMember(const CppTL::ConstString& key) const;
573-
#endif
574535

575536
/// \brief Return a list of the member names.
576537
///
@@ -579,11 +540,6 @@ class JSON_API Value {
579540
/// \post if type() was nullValue, it remains nullValue
580541
Members getMemberNames() const;
581542

582-
//# ifdef JSON_USE_CPPTL
583-
// EnumMemberNames enumMemberNames() const;
584-
// EnumValues enumValues() const;
585-
//# endif
586-
587543
/// \deprecated Always pass len.
588544
JSONCPP_DEPRECATED("Use setComment(String const&) instead.")
589545
void setComment(const char* comment, CommentPlacement placement) {
@@ -706,11 +662,6 @@ template <> inline float Value::as<float>() const { return asFloat(); }
706662
template <> inline const char* Value::as<const char*>() const {
707663
return asCString();
708664
}
709-
#ifdef JSON_USE_CPPTL
710-
template <> inline CppTL::ConstString Value::as<CppTL::ConstString>() const {
711-
return asConstString();
712-
}
713-
#endif
714665

715666
/** \brief Experimental and untested: represents an element of the "path" to
716667
* access a node.
@@ -960,4 +911,4 @@ inline void swap(Value& a, Value& b) { a.swap(b); }
960911
#pragma warning(pop)
961912
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
962913

963-
#endif // CPPTL_JSON_H_INCLUDED
914+
#endif // JSON_H_INCLUDED

meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ project(
2121
jsoncpp_headers = [
2222
'include/json/allocator.h',
2323
'include/json/assertions.h',
24-
'include/json/autolink.h',
2524
'include/json/config.h',
2625
'include/json/json_features.h',
2726
'include/json/forwards.h',

0 commit comments

Comments
 (0)