@@ -39,11 +39,11 @@ namespace Json {
39
39
*/
40
40
class JSON_API Exception : public std::exception {
41
41
public:
42
- Exception (std::string const & msg);
42
+ Exception (JSONCPP_STRING const & msg);
43
43
~Exception () throw () override ;
44
44
char const * what () const throw() override ;
45
45
protected:
46
- std::string msg_;
46
+ JSONCPP_STRING msg_;
47
47
};
48
48
49
49
/* * Exceptions which the user cannot easily avoid.
@@ -54,7 +54,7 @@ class JSON_API Exception : public std::exception {
54
54
*/
55
55
class JSON_API RuntimeError : public Exception {
56
56
public:
57
- RuntimeError (std::string const & msg);
57
+ RuntimeError (JSONCPP_STRING const & msg);
58
58
};
59
59
60
60
/* * Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
@@ -65,13 +65,13 @@ class JSON_API RuntimeError : public Exception {
65
65
*/
66
66
class JSON_API LogicError : public Exception {
67
67
public:
68
- LogicError (std::string const & msg);
68
+ LogicError (JSONCPP_STRING const & msg);
69
69
};
70
70
71
71
// / used internally
72
- void throwRuntimeError (std::string const & msg);
72
+ void throwRuntimeError (JSONCPP_STRING const & msg);
73
73
// / used internally
74
- void throwLogicError (std::string const & msg);
74
+ void throwLogicError (JSONCPP_STRING const & msg);
75
75
76
76
/* * \brief Type of the value held by a Value object.
77
77
*/
@@ -162,7 +162,7 @@ class JSON_API StaticString {
162
162
class JSON_API Value {
163
163
friend class ValueIteratorBase ;
164
164
public:
165
- typedef std::vector<std::string > Members;
165
+ typedef std::vector<JSONCPP_STRING > Members;
166
166
typedef ValueIterator iterator;
167
167
typedef ValueConstIterator const_iterator;
168
168
typedef Json::UInt UInt;
@@ -290,7 +290,7 @@ Json::Value obj_value(Json::objectValue); // {}
290
290
* \endcode
291
291
*/
292
292
Value (const StaticString& value);
293
- Value (const std::string & value); // /< Copy data() til size(). Embedded zeroes too.
293
+ Value (const JSONCPP_STRING & value); // /< Copy data() til size(). Embedded zeroes too.
294
294
#ifdef JSON_USE_CPPTL
295
295
Value (const CppTL::ConstString& value);
296
296
#endif
@@ -323,7 +323,7 @@ Json::Value obj_value(Json::objectValue); // {}
323
323
int compare (const Value& other) const ;
324
324
325
325
const char * asCString () const ; // /< Embedded zeroes could cause you trouble!
326
- std::string asString () const ; // /< Embedded zeroes are possible.
326
+ JSONCPP_STRING asString () const ; // /< Embedded zeroes are possible.
327
327
/* * Get raw char* of string-value.
328
328
* \return false if !string. (Seg-fault if str or end are NULL.)
329
329
*/
@@ -427,11 +427,11 @@ Json::Value obj_value(Json::objectValue); // {}
427
427
const Value& operator [](const char * key) const ;
428
428
// / Access an object value by name, create a null member if it does not exist.
429
429
// / \param key may contain embedded nulls.
430
- Value& operator [](const std::string & key);
430
+ Value& operator [](const JSONCPP_STRING & key);
431
431
// / Access an object value by name, returns null if there is no member with
432
432
// / that name.
433
433
// / \param key may contain embedded nulls.
434
- const Value& operator [](const std::string & key) const ;
434
+ const Value& operator [](const JSONCPP_STRING & key) const ;
435
435
/* * \brief Access an object value by name, create a null member if it does not
436
436
exist.
437
437
@@ -462,7 +462,7 @@ Json::Value obj_value(Json::objectValue); // {}
462
462
// / Return the member named key if it exist, defaultValue otherwise.
463
463
// / \note deep copy
464
464
// / \param key may contain embedded nulls.
465
- Value get (const std::string & key, const Value& defaultValue) const ;
465
+ Value get (const JSONCPP_STRING & key, const Value& defaultValue) const ;
466
466
#ifdef JSON_USE_CPPTL
467
467
// / Return the member named key if it exist, defaultValue otherwise.
468
468
// / \note deep copy
@@ -487,7 +487,7 @@ Json::Value obj_value(Json::objectValue); // {}
487
487
// / Same as removeMember(const char*)
488
488
// / \param key may contain embedded nulls.
489
489
// / \deprecated
490
- Value removeMember (const std::string & key);
490
+ Value removeMember (const JSONCPP_STRING & key);
491
491
// / Same as removeMember(const char* begin, const char* end, Value* removed),
492
492
// / but 'key' is null-terminated.
493
493
bool removeMember (const char * key, Value* removed);
@@ -497,8 +497,8 @@ Json::Value obj_value(Json::objectValue); // {}
497
497
\param key may contain embedded nulls.
498
498
\return true iff removed (no exceptions)
499
499
*/
500
- bool removeMember (std::string const & key, Value* removed);
501
- // / Same as removeMember(std::string const& key, Value* removed)
500
+ bool removeMember (JSONCPP_STRING const & key, Value* removed);
501
+ // / Same as removeMember(JSONCPP_STRING const& key, Value* removed)
502
502
bool removeMember (const char * begin, const char * end, Value* removed);
503
503
/* * \brief Remove the indexed array element.
504
504
@@ -513,8 +513,8 @@ Json::Value obj_value(Json::objectValue); // {}
513
513
bool isMember (const char * key) const ;
514
514
// / Return true if the object has a member named key.
515
515
// / \param key may contain embedded nulls.
516
- bool isMember (const std::string & key) const ;
517
- // / Same as isMember(std::string const& key)const
516
+ bool isMember (const JSONCPP_STRING & key) const ;
517
+ // / Same as isMember(JSONCPP_STRING const& key)const
518
518
bool isMember (const char * begin, const char * end) const ;
519
519
#ifdef JSON_USE_CPPTL
520
520
// / Return true if the object has a member named key.
@@ -534,17 +534,17 @@ Json::Value obj_value(Json::objectValue); // {}
534
534
// # endif
535
535
536
536
// / \deprecated Always pass len.
537
- JSONCPP_DEPRECATED (" Use setComment(std::string const&) instead." )
537
+ JSONCPP_DEPRECATED (" Use setComment(JSONCPP_STRING const&) instead." )
538
538
void setComment (const char * comment, CommentPlacement placement);
539
539
// / Comments must be //... or /* ... */
540
540
void setComment (const char * comment, size_t len, CommentPlacement placement);
541
541
// / Comments must be //... or /* ... */
542
- void setComment (const std::string & comment, CommentPlacement placement);
542
+ void setComment (const JSONCPP_STRING & comment, CommentPlacement placement);
543
543
bool hasComment (CommentPlacement placement) const ;
544
544
// / Include delimiters and embedded newlines.
545
- std::string getComment (CommentPlacement placement) const ;
545
+ JSONCPP_STRING getComment (CommentPlacement placement) const ;
546
546
547
- std::string toStyledString () const ;
547
+ JSONCPP_STRING toStyledString () const ;
548
548
549
549
const_iterator begin () const ;
550
550
const_iterator end () const ;
@@ -612,15 +612,15 @@ class JSON_API PathArgument {
612
612
PathArgument ();
613
613
PathArgument (ArrayIndex index);
614
614
PathArgument (const char * key);
615
- PathArgument (const std::string & key);
615
+ PathArgument (const JSONCPP_STRING & key);
616
616
617
617
private:
618
618
enum Kind {
619
619
kindNone = 0 ,
620
620
kindIndex,
621
621
kindKey
622
622
};
623
- std::string key_;
623
+ JSONCPP_STRING key_;
624
624
ArrayIndex index_;
625
625
Kind kind_;
626
626
};
@@ -638,7 +638,7 @@ class JSON_API PathArgument {
638
638
*/
639
639
class JSON_API Path {
640
640
public:
641
- Path (const std::string & path,
641
+ Path (const JSONCPP_STRING & path,
642
642
const PathArgument& a1 = PathArgument(),
643
643
const PathArgument& a2 = PathArgument(),
644
644
const PathArgument& a3 = PathArgument(),
@@ -655,12 +655,12 @@ class JSON_API Path {
655
655
typedef std::vector<const PathArgument*> InArgs;
656
656
typedef std::vector<PathArgument> Args;
657
657
658
- void makePath (const std::string & path, const InArgs& in);
659
- void addPathInArg (const std::string & path,
658
+ void makePath (const JSONCPP_STRING & path, const InArgs& in);
659
+ void addPathInArg (const JSONCPP_STRING & path,
660
660
const InArgs& in,
661
661
InArgs::const_iterator& itInArg,
662
662
PathArgument::Kind kind);
663
- void invalidPath (const std::string & path, int location);
663
+ void invalidPath (const JSONCPP_STRING & path, int location);
664
664
665
665
Args args_;
666
666
};
@@ -693,7 +693,7 @@ class JSON_API ValueIteratorBase {
693
693
// / Return the member name of the referenced Value, or "" if it is not an
694
694
// / objectValue.
695
695
// / \note Avoid `c_str()` on result, as embedded zeroes are possible.
696
- std::string name () const ;
696
+ JSONCPP_STRING name () const ;
697
697
698
698
// / Return the member name of the referenced Value. "" if it is not an
699
699
// / objectValue.
0 commit comments