Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
fc6d7a59
Commit
fc6d7a59
authored
Jul 31, 2014
by
Philipp A. Hartmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GenericValue: rename Erase(ConstMemberIterator) to EraseMember
parent
82b32a93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
document.h
include/rapidjson/document.h
+4
-4
valuetest.cpp
test/unittest/valuetest.cpp
+6
-6
No files found.
include/rapidjson/document.h
View file @
fc6d7a59
...
...
@@ -850,7 +850,7 @@ public:
/*! \param m member iterator (obtained by FindMember() or MemberBegin()).
\return the new iterator after removal.
\note Removing member is implemented by moving the last member. So the ordering of members is changed.
\note Use \ref Erase(ConstMemberIterator) instead, if you need to rely on a stable member ordering.
\note Use \ref Erase
Member
(ConstMemberIterator) instead, if you need to rely on a stable member ordering.
*/
MemberIterator
RemoveMember
(
MemberIterator
m
)
{
RAPIDJSON_ASSERT
(
IsObject
());
...
...
@@ -878,8 +878,8 @@ public:
If the iterator \c pos refers to the last element, the \ref MemberEnd() iterator is returned.
\note Other than \ref RemoveMember(MemberIterator), this function preserves the ordering of the members.
*/
MemberIterator
Erase
(
ConstMemberIterator
pos
)
{
return
Erase
(
pos
,
pos
+
1
);
MemberIterator
Erase
Member
(
ConstMemberIterator
pos
)
{
return
Erase
Member
(
pos
,
pos
+
1
);
}
//! Remove members in the range [first, last) from an object.
...
...
@@ -889,7 +889,7 @@ public:
\return Iterator following the last removed element.
\note Other than \ref RemoveMember(MemberIterator), this function preserves the ordering of the members.
*/
MemberIterator
Erase
(
ConstMemberIterator
first
,
ConstMemberIterator
last
)
{
MemberIterator
Erase
Member
(
ConstMemberIterator
first
,
ConstMemberIterator
last
)
{
RAPIDJSON_ASSERT
(
IsObject
());
RAPIDJSON_ASSERT
(
data_
.
o
.
size
>
0
);
RAPIDJSON_ASSERT
(
data_
.
o
.
members
!=
0
);
...
...
test/unittest/valuetest.cpp
View file @
fc6d7a59
...
...
@@ -789,7 +789,7 @@ TEST(Value, Object) {
EXPECT_TRUE
(
x
.
MemberBegin
()
==
x
.
MemberEnd
());
// Erase(ConstMemberIterator)
// Erase
Member
(ConstMemberIterator)
// Use array members to ensure removed elements' destructor is called.
// { "a": [0], "b": [1],[2],...]
...
...
@@ -798,7 +798,7 @@ TEST(Value, Object) {
x
.
AddMember
(
keys
[
i
],
Value
(
kArrayType
).
PushBack
(
i
,
allocator
),
allocator
);
// Erase the first
itr
=
x
.
Erase
(
x
.
MemberBegin
());
itr
=
x
.
Erase
Member
(
x
.
MemberBegin
());
EXPECT_FALSE
(
x
.
HasMember
(
keys
[
0
]));
EXPECT_EQ
(
x
.
MemberBegin
(),
itr
);
EXPECT_EQ
(
9u
,
x
.
MemberEnd
()
-
x
.
MemberBegin
());
...
...
@@ -809,7 +809,7 @@ TEST(Value, Object) {
}
// Erase the last
itr
=
x
.
Erase
(
x
.
MemberEnd
()
-
1
);
itr
=
x
.
Erase
Member
(
x
.
MemberEnd
()
-
1
);
EXPECT_FALSE
(
x
.
HasMember
(
keys
[
9
]));
EXPECT_EQ
(
x
.
MemberEnd
(),
itr
);
EXPECT_EQ
(
8u
,
x
.
MemberEnd
()
-
x
.
MemberBegin
());
...
...
@@ -820,7 +820,7 @@ TEST(Value, Object) {
}
// Erase the middle
itr
=
x
.
Erase
(
x
.
MemberBegin
()
+
4
);
itr
=
x
.
Erase
Member
(
x
.
MemberBegin
()
+
4
);
EXPECT_FALSE
(
x
.
HasMember
(
keys
[
5
]));
EXPECT_EQ
(
x
.
MemberBegin
()
+
4
,
itr
);
EXPECT_EQ
(
7u
,
x
.
MemberEnd
()
-
x
.
MemberBegin
());
...
...
@@ -831,7 +831,7 @@ TEST(Value, Object) {
EXPECT_EQ
(
i
,
itr
->
value
[
0u
].
GetInt
());
}
// Erase(ConstMemberIterator, ConstMemberIterator)
// Erase
Member
(ConstMemberIterator, ConstMemberIterator)
// Exhaustive test with all 0 <= first < n, first <= last <= n cases
const
unsigned
n
=
10
;
for
(
unsigned
first
=
0
;
first
<
n
;
first
++
)
{
...
...
@@ -840,7 +840,7 @@ TEST(Value, Object) {
for
(
unsigned
i
=
0
;
i
<
n
;
i
++
)
x
.
AddMember
(
keys
[
i
],
Value
(
kArrayType
).
PushBack
(
i
,
allocator
),
allocator
);
itr
=
x
.
Erase
(
x
.
MemberBegin
()
+
first
,
x
.
MemberBegin
()
+
last
);
itr
=
x
.
Erase
Member
(
x
.
MemberBegin
()
+
first
,
x
.
MemberBegin
()
+
last
);
if
(
last
==
n
)
EXPECT_EQ
(
x
.
MemberEnd
(),
itr
);
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment