Change MemberEmpty() to ObjectEmpty()

This commit is contained in:
Milo Yip 2014-08-28 20:25:41 +08:00
parent dc834c9c03
commit 284dcf3dc5
2 changed files with 5 additions and 5 deletions

View File

@ -748,7 +748,7 @@ public:
SizeType MemberCount() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size; } SizeType MemberCount() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size; }
//! Check whether the object is empty. //! Check whether the object is empty.
bool MemberEmpty() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; } bool ObjectEmpty() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; }
//! Get the value associated with the name. //! Get the value associated with the name.
/*! /*!

View File

@ -763,16 +763,16 @@ TEST(Value, Object) {
EXPECT_EQ(kObjectType, x.GetType()); EXPECT_EQ(kObjectType, x.GetType());
EXPECT_TRUE(x.IsObject()); EXPECT_TRUE(x.IsObject());
EXPECT_TRUE(x.MemberEmpty()); EXPECT_TRUE(x.ObjectEmpty());
EXPECT_EQ(0u, x.MemberCount()); EXPECT_EQ(0u, x.MemberCount());
EXPECT_EQ(kObjectType, y.GetType()); EXPECT_EQ(kObjectType, y.GetType());
EXPECT_TRUE(y.IsObject()); EXPECT_TRUE(y.IsObject());
EXPECT_TRUE(y.MemberEmpty()); EXPECT_TRUE(y.ObjectEmpty());
EXPECT_EQ(0u, y.MemberCount()); EXPECT_EQ(0u, y.MemberCount());
// AddMember() // AddMember()
x.AddMember("A", "Apple", allocator); x.AddMember("A", "Apple", allocator);
EXPECT_FALSE(x.MemberEmpty()); EXPECT_FALSE(x.ObjectEmpty());
EXPECT_EQ(1u, x.MemberCount()); EXPECT_EQ(1u, x.MemberCount());
Value value("Banana", 6); Value value("Banana", 6);
@ -965,7 +965,7 @@ TEST(Value, Object) {
// RemoveAllMembers() // RemoveAllMembers()
x.RemoveAllMembers(); x.RemoveAllMembers();
EXPECT_TRUE(x.MemberEmpty()); EXPECT_TRUE(x.ObjectEmpty());
EXPECT_EQ(0u, x.MemberCount()); EXPECT_EQ(0u, x.MemberCount());
// SetObject() // SetObject()