@@ -392,16 +392,18 @@ class JSON_API Value {
392
392
unsigned getCStringLength () const ; // Allows you to understand the length of the CString
393
393
template <typename T = JSONCPP_STRING>
394
394
T asString () const { // /< Embedded zeroes are possible.
395
- switch (type_ ) {
395
+ switch (type () ) {
396
396
case nullValue:
397
397
return " " ;
398
398
case stringValue:
399
399
{
400
- if (value_.string_ == 0 ) return " " ;
400
+ if (value_.string_ == nullptr )
401
+ return " " ;
401
402
unsigned this_len;
402
403
char const * this_str;
403
- decodePrefixedString (this ->allocated_ , this ->value_ .string_ , &this_len, &this_str);
404
- return T (this_str, this_str + this_len);
404
+ decodePrefixedString (this ->isAllocated (), this ->value_ .string_ , &this_len,
405
+ &this_str);
406
+ return T (this_str, this_len);
405
407
}
406
408
case booleanValue:
407
409
return value_.bool_ ? " true" : " false" ;
@@ -589,9 +591,6 @@ class JSON_API Value {
589
591
// / \post type() is unchanged
590
592
void removeMember (const char * key);
591
593
592
- // / Same as removeMember(JSONCPP_STRING const& key, Value* removed)
593
- bool removeMember (const char * begin, const char * end, Value* removed);
594
-
595
594
#if JSONCPP_USING_SECURE_MEMORY
596
595
// / Same as removeMember(const char*)
597
596
// / \param key may contain embedded nulls.
@@ -643,8 +642,6 @@ class JSON_API Value {
643
642
// / Return true if the object has a member named key.
644
643
// / \note 'key' must be null-terminated.
645
644
bool isMember (const char * key) const ;
646
- // / Same as isMember(JSONCPP_STRING const& key)const
647
- bool isMember (const char * begin, const char * end) const ;
648
645
#if JSONCPP_USING_SECURE_MEMORY
649
646
// / Return true if the object has a member named key.
650
647
// / \param key may contain embedded nulls.
0 commit comments