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
8b2faff9
Commit
8b2faff9
authored
Sep 04, 2014
by
Kosta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enhance `IterativeParsingReaderHandler` to check for `Key()` events
parent
c8da4d86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
readertest.cpp
test/unittest/readertest.cpp
+7
-6
No files found.
test/unittest/readertest.cpp
View file @
8b2faff9
...
...
@@ -819,9 +819,10 @@ struct IterativeParsingReaderHandler {
const
static
int
LOG_DOUBLE
=
-
7
;
const
static
int
LOG_STRING
=
-
8
;
const
static
int
LOG_STARTOBJECT
=
-
9
;
const
static
int
LOG_ENDOBJECT
=
-
10
;
const
static
int
LOG_STARTARRAY
=
-
11
;
const
static
int
LOG_ENDARRAY
=
-
12
;
const
static
int
LOG_KEY
=
-
10
;
const
static
int
LOG_ENDOBJECT
=
-
11
;
const
static
int
LOG_STARTARRAY
=
-
12
;
const
static
int
LOG_ENDARRAY
=
-
13
;
const
static
size_t
LogCapacity
=
256
;
int
Logs
[
LogCapacity
];
...
...
@@ -848,7 +849,7 @@ struct IterativeParsingReaderHandler {
bool
StartObject
()
{
RAPIDJSON_ASSERT
(
LogCount
<
LogCapacity
);
Logs
[
LogCount
++
]
=
LOG_STARTOBJECT
;
return
true
;
}
bool
Key
(
const
Ch
*
str
,
SizeType
len
,
bool
copy
)
{
return
String
(
str
,
len
,
copy
)
;
}
bool
Key
(
const
Ch
*
str
,
SizeType
len
,
bool
copy
)
{
RAPIDJSON_ASSERT
(
LogCount
<
LogCapacity
);
Logs
[
LogCount
++
]
=
LOG_KEY
;
return
true
;
}
bool
EndObject
(
SizeType
c
)
{
RAPIDJSON_ASSERT
(
LogCount
<
LogCapacity
);
...
...
@@ -882,7 +883,7 @@ TEST(Reader, IterativeParsing_General) {
handler
.
LOG_STARTARRAY
,
handler
.
LOG_INT
,
handler
.
LOG_STARTOBJECT
,
handler
.
LOG_
STRING
,
handler
.
LOG_
KEY
,
handler
.
LOG_STARTARRAY
,
handler
.
LOG_INT
,
handler
.
LOG_INT
,
...
...
@@ -920,7 +921,7 @@ TEST(Reader, IterativeParsing_Count) {
handler
.
LOG_STARTOBJECT
,
handler
.
LOG_ENDOBJECT
,
0
,
handler
.
LOG_STARTOBJECT
,
handler
.
LOG_
STRING
,
handler
.
LOG_
KEY
,
handler
.
LOG_INT
,
handler
.
LOG_ENDOBJECT
,
1
,
handler
.
LOG_STARTARRAY
,
...
...
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