Skip to content

Commit 5e4ef08

Browse files
committed
change #9000: fixes after merge
1 parent bdf7ca8 commit 5e4ef08

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

include/json/allocator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <cstring>
1010
#include <memory>
11+
#include <string.h>
1112

1213
#pragma pack(push)
1314
#pragma pack()

include/json/value.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,16 +392,18 @@ class JSON_API Value {
392392
unsigned getCStringLength() const; //Allows you to understand the length of the CString
393393
template<typename T = JSONCPP_STRING>
394394
T asString() const { ///< Embedded zeroes are possible.
395-
switch (type_) {
395+
switch (type()) {
396396
case nullValue:
397397
return "";
398398
case stringValue:
399399
{
400-
if (value_.string_ == 0) return "";
400+
if (value_.string_ == nullptr)
401+
return "";
401402
unsigned this_len;
402403
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);
405407
}
406408
case booleanValue:
407409
return value_.bool_ ? "true" : "false";
@@ -589,9 +591,6 @@ class JSON_API Value {
589591
/// \post type() is unchanged
590592
void removeMember(const char* key);
591593

592-
/// Same as removeMember(JSONCPP_STRING const& key, Value* removed)
593-
bool removeMember(const char* begin, const char* end, Value* removed);
594-
595594
#if JSONCPP_USING_SECURE_MEMORY
596595
/// Same as removeMember(const char*)
597596
/// \param key may contain embedded nulls.
@@ -643,8 +642,6 @@ class JSON_API Value {
643642
/// Return true if the object has a member named key.
644643
/// \note 'key' must be null-terminated.
645644
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;
648645
#if JSONCPP_USING_SECURE_MEMORY
649646
/// Return true if the object has a member named key.
650647
/// \param key may contain embedded nulls.

0 commit comments

Comments
 (0)