Skip to content

Commit ff10e63

Browse files
committed
remove CPPTL
1 parent ecb2362 commit ff10e63

File tree

12 files changed

+27
-182
lines changed

12 files changed

+27
-182
lines changed

include/json/autolink.h

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

include/json/config.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
#ifndef JSONCPP_CONFIG_H_INCLUDED
77
#define JSONCPP_CONFIG_H_INCLUDED
88

9-
/// If defined, indicates that json library is embedded in CppTL library.
10-
// # define JSONCPP_IN_CPPTL 1
11-
12-
/// If defined, indicates that json may leverage CppTL library
13-
// # define JSONCPP_USE_CPPTL 1
14-
/// If defined, indicates that cpptl vector based map should be used instead of std::map
15-
/// as Value container.
16-
// # define JSONCPP_USE_CPPTL_SMALLMAP 1
179
/// If defined, indicates that Json specific container should be used
1810
/// (hash table & simple deque container with customizable allocator).
1911
/// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332
@@ -37,16 +29,7 @@
3729
/// Remarks: defining this macro enables the functionality of: JSONCPP_ASSERT_UNREACHABLE, JSONCPP_ASSERT, JSONCPP_FAIL_MESSAGE, and JSONCPP_ASSERT_MESSAGE
3830
// # define JSONCPP_ENABLE_ASSERTS 1
3931

40-
#ifdef JSONCPP_IN_CPPTL
41-
#include <cpptl/config.h>
42-
#ifndef JSONCPP_USE_CPPTL
43-
#define JSONCPP_USE_CPPTL 1
44-
#endif
45-
#endif
46-
47-
#ifdef JSONCPP_IN_CPPTL
48-
#define JSONCPP_API CPPTL_API
49-
#elif defined(JSONCPP_DLL_BUILD)
32+
#if defined(JSONCPP_DLL_BUILD)
5033
#define JSONCPP_API __declspec(dllexport)
5134
#elif defined(JSONCPP_DLL)
5235
#define JSONCPP_API __declspec(dllimport)

include/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_JSONCPP_FEATURES_H_INCLUDED
7-
#define CPPTL_JSONCPP_FEATURES_H_INCLUDED
6+
#ifndef JSONCPP_FEATURES_H_INCLUDED
7+
#define JSONCPP_FEATURES_H_INCLUDED
88

99
#if !defined(JSONCPP_IS_AMALGAMATION)
1010
#include "forwards.h"
@@ -45,4 +45,4 @@ namespace Json {
4545

4646
} // namespace Json
4747

48-
#endif // CPPTL_JSONCPP_FEATURES_H_INCLUDED
48+
#endif // JSONCPP_FEATURES_H_INCLUDED

include/json/json.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
#ifndef JSONCPP_JSON_H_INCLUDED
77
#define JSONCPP_JSON_H_INCLUDED
88

9-
#include "autolink.h"
10-
#include "features.h"
11-
#include "reader.h"
9+
#include "config.h"
1210
#include "value.h"
11+
#include "reader.h"
1312
#include "writer.h"
13+
#include "features.h"
1414

1515
#endif // JSONCPP_JSON_H_INCLUDED

include/json/reader.h

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

6-
#ifndef CPPTL_JSONCPP_READER_H_INCLUDED
7-
#define CPPTL_JSONCPP_READER_H_INCLUDED
6+
#ifndef JSONCPP_READER_H_INCLUDED
7+
#define JSONCPP_READER_H_INCLUDED
88

99
#if !defined(JSONCPP_IS_AMALGAMATION)
1010
#include "features.h"
1111
#include "value.h"
1212
#endif // if !defined(JSONCPP_IS_AMALGAMATION)
1313
#include <deque>
14-
#include <iostream>
1514
#include <stack>
1615
#include <string>
16+
#include <iostream>
1717

1818
namespace Json {
1919

@@ -186,4 +186,4 @@ namespace Json {
186186

187187
} // namespace Json
188188

189-
#endif // CPPTL_JSONCPP_READER_H_INCLUDED
189+
#endif // JSONCPP_READER_H_INCLUDED

include/json/value.h

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

6-
#ifndef CPPTL_JSONCPP_H_INCLUDED
7-
#define CPPTL_JSONCPP_H_INCLUDED
6+
#ifndef JSONCPP_H_INCLUDED
7+
#define JSONCPP_H_INCLUDED
88

99
#if !defined(JSONCPP_IS_AMALGAMATION)
1010
#include "forwards.h"
1111
#endif // if !defined(JSONCPP_IS_AMALGAMATION)
1212
#include <string>
1313
#include <vector>
14-
15-
#ifndef JSONCPP_USE_CPPTL_SMALLMAP
1614
#include <map>
17-
#else
18-
#include <cpptl/smallmap.h>
19-
#endif
20-
#ifdef JSONCPP_USE_CPPTL
21-
#include <cpptl/forwards.h>
22-
#endif
2315

2416
#ifdef JSONCPP_ENABLE_ASSERTS
2517
#define JSONCPP_ASSERT_UNREACHABLE assert(false)
@@ -59,11 +51,6 @@ namespace Json {
5951
numberOfCommentPlacement
6052
};
6153

62-
// # ifdef JSONCPP_USE_CPPTL
63-
// typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
64-
// typedef CppTL::AnyEnumerator<const Value &> EnumValues;
65-
// # endif
66-
6754
/** \brief Lightweight wrapper to tag static string.
6855
*
6956
* Value constructor and objectValue member assignement takes advantage of the
@@ -191,11 +178,7 @@ namespace Json {
191178
};
192179

193180
public:
194-
#ifndef JSONCPP_USE_CPPTL_SMALLMAP
195181
typedef std::map<CZString, Value> ObjectValues;
196-
#else
197-
typedef CppTL::SmallMap<CZString, Value> ObjectValues;
198-
#endif // ifndef JSONCPP_USE_CPPTL_SMALLMAP
199182
#endif // ifndef JSONCPP_VALUE_USE_INTERNAL_MAP
200183
#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
201184

@@ -237,9 +220,6 @@ namespace Json {
237220
*/
238221
Value(const StaticString& value);
239222
Value(const std::string& value);
240-
#ifdef JSONCPP_USE_CPPTL
241-
Value(const CppTL::ConstString& value);
242-
#endif
243223
Value(bool value);
244224
Value(const Value& other);
245225
~Value();
@@ -264,9 +244,6 @@ namespace Json {
264244

265245
const char* asCString() const;
266246
std::string asString(const std::string& defaultValue = "") const;
267-
#ifdef JSONCPP_USE_CPPTL
268-
CppTL::ConstString asConstString() const;
269-
#endif
270247
Int asInt(Value::Int defaultValue = 0) const;
271248
UInt asUInt(Value::UInt defaultValue = 0) const;
272249
Int64 asInt64(Value::Int64 defaultValue = 0) const;
@@ -366,20 +343,10 @@ namespace Json {
366343
* \endcode
367344
*/
368345
Value& operator[](const StaticString& key);
369-
#ifdef JSONCPP_USE_CPPTL
370-
/// Access an object value by name, create a null member if it does not exist.
371-
Value& operator[](const CppTL::ConstString& key);
372-
/// Access an object value by name, returns null if there is no member with that name.
373-
const Value& operator[](const CppTL::ConstString& key) const;
374-
#endif
375346
/// Return the member named key if it exist, defaultValue otherwise.
376347
Value get(const char* key, const Value& defaultValue) const;
377348
/// Return the member named key if it exist, defaultValue otherwise.
378349
Value get(const std::string& key, const Value& defaultValue) const;
379-
#ifdef JSONCPP_USE_CPPTL
380-
/// Return the member named key if it exist, defaultValue otherwise.
381-
Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
382-
#endif
383350
/// \brief Remove and return the named member.
384351
///
385352
/// Do nothing if it did not exist.
@@ -394,10 +361,6 @@ namespace Json {
394361
bool isMember(const char* key) const;
395362
/// Return true if the object has a member named key.
396363
bool isMember(const std::string& key) const;
397-
#ifdef JSONCPP_USE_CPPTL
398-
/// Return true if the object has a member named key.
399-
bool isMember(const CppTL::ConstString& key) const;
400-
#endif
401364

402365
/// \brief Return a list of the member names.
403366
///
@@ -406,11 +369,6 @@ namespace Json {
406369
/// \post if type() was nullValue, it remains nullValue
407370
Members getMemberNames() const;
408371

409-
// # ifdef JSONCPP_USE_CPPTL
410-
// EnumMemberNames enumMemberNames() const;
411-
// EnumValues enumValues() const;
412-
// # endif
413-
414372
/// Comments must be //... or /* ... */
415373
void setComment(const char* comment, CommentPlacement placement);
416374
/// Comments must be //... or /* ... */
@@ -1030,4 +988,4 @@ namespace Json {
1030988

1031989
} // namespace Json
1032990

1033-
#endif // CPPTL_JSONCPP_H_INCLUDED
991+
#endif // JSONCPP_H_INCLUDED

include/json/writer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#if !defined(JSONCPP_IS_AMALGAMATION)
1010
#include "value.h"
1111
#endif // if !defined(JSONCPP_IS_AMALGAMATION)
12-
#include <iostream>
13-
#include <string>
1412
#include <vector>
13+
#include <string>
14+
#include <iostream>
1515

1616
namespace Json {
1717

src/lib_json/json_batchallocator.h

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

9-
#include <assert.h>
109
#include <stdlib.h>
10+
#include <assert.h>
1111

1212
#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
1313

src/lib_json/json_reader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
#include <json/value.h>
99
#include "json_tool.h"
1010
#endif // if !defined(JSONCPP_IS_AMALGAMATION)
11-
#include <cassert>
11+
#include <utility>
1212
#include <cstdio>
13+
#include <cassert>
1314
#include <cstring>
1415
#include <iostream>
1516
#include <stdexcept>
16-
#include <utility>
1717

1818
#if _MSC_VER >= 1400 // VC++ 8.0
1919
#pragma warning(disable : 4996) // disable warning about strdup being deprecated.

0 commit comments

Comments
 (0)