3
3
// recognized in your jurisdiction.
4
4
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5
5
6
- #ifndef CPPTL_JSON_H_INCLUDED
7
- #define CPPTL_JSON_H_INCLUDED
6
+ #ifndef JSON_H_INCLUDED
7
+ #define JSON_H_INCLUDED
8
8
9
9
#if !defined(JSON_IS_AMALGAMATION)
10
10
#include " forwards.h"
23
23
24
24
#include < array>
25
25
#include < exception>
26
+ #include < map>
26
27
#include < memory>
27
28
#include < string>
28
29
#include < vector>
29
30
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
-
39
31
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
40
32
// be used by...
41
33
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
@@ -120,11 +112,6 @@ enum PrecisionType {
120
112
decimalPlaces // /< we set max number of digits after "." in string
121
113
};
122
114
123
- // # ifdef JSON_USE_CPPTL
124
- // typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
125
- // typedef CppTL::AnyEnumerator<const Value &> EnumValues;
126
- // # endif
127
-
128
115
/* * \brief Lightweight wrapper to tag static string.
129
116
*
130
117
* Value constructor and objectValue member assignment takes advantage of the
@@ -287,11 +274,7 @@ class JSON_API Value {
287
274
};
288
275
289
276
public:
290
- #ifndef JSON_USE_CPPTL_SMALLMAP
291
277
typedef std::map<CZString, Value> ObjectValues;
292
- #else
293
- typedef CppTL::SmallMap<CZString, Value> ObjectValues;
294
- #endif // ifndef JSON_USE_CPPTL_SMALLMAP
295
278
#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
296
279
297
280
public:
@@ -340,9 +323,6 @@ class JSON_API Value {
340
323
*/
341
324
Value (const StaticString& value);
342
325
Value (const String& value);
343
- #ifdef JSON_USE_CPPTL
344
- Value (const CppTL::ConstString& value);
345
- #endif
346
326
Value (bool value);
347
327
Value (const Value& other);
348
328
Value (Value&& other);
@@ -384,9 +364,6 @@ class JSON_API Value {
384
364
* \return false if !string. (Seg-fault if str or end are NULL.)
385
365
*/
386
366
bool getString (char const ** begin, char const ** end) const ;
387
- #ifdef JSON_USE_CPPTL
388
- CppTL::ConstString asConstString () const ;
389
- #endif
390
367
Int asInt () const ;
391
368
UInt asUInt () const ;
392
369
#if defined(JSON_HAS_INT64)
@@ -498,13 +475,6 @@ class JSON_API Value {
498
475
* \endcode
499
476
*/
500
477
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
508
478
// / Return the member named key if it exist, defaultValue otherwise.
509
479
// / \note deep copy
510
480
Value get (const char * key, const Value& defaultValue) const ;
@@ -517,11 +487,6 @@ class JSON_API Value {
517
487
// / \note deep copy
518
488
// / \param key may contain embedded nulls.
519
489
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
525
490
// / Most general and efficient version of isMember()const, get()const,
526
491
// / and operator[]const
527
492
// / \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
@@ -567,10 +532,6 @@ class JSON_API Value {
567
532
bool isMember (const String& key) const ;
568
533
// / Same as isMember(String const& key)const
569
534
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
574
535
575
536
// / \brief Return a list of the member names.
576
537
// /
@@ -579,11 +540,6 @@ class JSON_API Value {
579
540
// / \post if type() was nullValue, it remains nullValue
580
541
Members getMemberNames () const ;
581
542
582
- // # ifdef JSON_USE_CPPTL
583
- // EnumMemberNames enumMemberNames() const;
584
- // EnumValues enumValues() const;
585
- // # endif
586
-
587
543
// / \deprecated Always pass len.
588
544
JSONCPP_DEPRECATED (" Use setComment(String const&) instead." )
589
545
void setComment (const char * comment, CommentPlacement placement) {
@@ -706,11 +662,6 @@ template <> inline float Value::as<float>() const { return asFloat(); }
706
662
template <> inline const char * Value::as<const char *>() const {
707
663
return asCString ();
708
664
}
709
- #ifdef JSON_USE_CPPTL
710
- template <> inline CppTL::ConstString Value::as<CppTL::ConstString>() const {
711
- return asConstString ();
712
- }
713
- #endif
714
665
715
666
/* * \brief Experimental and untested: represents an element of the "path" to
716
667
* access a node.
@@ -960,4 +911,4 @@ inline void swap(Value& a, Value& b) { a.swap(b); }
960
911
#pragma warning(pop)
961
912
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
962
913
963
- #endif // CPPTL_JSON_H_INCLUDED
914
+ #endif // JSON_H_INCLUDED
0 commit comments