Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
38f8a51a
Unverified
Commit
38f8a51a
authored
Aug 16, 2018
by
Théo DELRIEU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use abstract sax class in parser tests
parent
9bbb1330
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
include/nlohmann/json.hpp
include/nlohmann/json.hpp
+1
-0
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+1
-0
test/src/unit-class_parser.cpp
test/src/unit-class_parser.cpp
+13
-13
No files found.
include/nlohmann/json.hpp
View file @
38f8a51a
...
...
@@ -212,6 +212,7 @@ class basic_json
using
initializer_list_t
=
std
::
initializer_list
<
detail
::
json_ref
<
basic_json
>>
;
using
input_format_t
=
detail
::
input_format_t
;
using
json_sax_t
=
json_sax
<
basic_json
>
;
////////////////
// exceptions //
...
...
single_include/nlohmann/json.hpp
View file @
38f8a51a
...
...
@@ -11078,6 +11078,7 @@ class basic_json
using
initializer_list_t
=
std
::
initializer_list
<
detail
::
json_ref
<
basic_json
>>
;
using
input_format_t
=
detail
::
input_format_t
;
using
json_sax_t
=
json_sax
<
basic_json
>
;
////////////////
// exceptions //
...
...
test/src/unit-class_parser.cpp
View file @
38f8a51a
...
...
@@ -129,68 +129,68 @@ class SaxEventLogger
bool
errored
=
false
;
};
class
SaxCountdown
class
SaxCountdown
:
public
nlohmann
::
json
::
json_sax_t
{
public:
explicit
SaxCountdown
(
const
int
count
)
:
events_left
(
count
)
{}
bool
null
()
bool
null
()
override
{
return
events_left
--
>
0
;
}
bool
boolean
(
bool
)
bool
boolean
(
bool
)
override
{
return
events_left
--
>
0
;
}
bool
number_integer
(
json
::
number_integer_t
)
bool
number_integer
(
json
::
number_integer_t
)
override
{
return
events_left
--
>
0
;
}
bool
number_unsigned
(
json
::
number_unsigned_t
)
bool
number_unsigned
(
json
::
number_unsigned_t
)
override
{
return
events_left
--
>
0
;
}
bool
number_float
(
json
::
number_float_t
,
const
std
::
string
&
)
bool
number_float
(
json
::
number_float_t
,
const
std
::
string
&
)
override
{
return
events_left
--
>
0
;
}
bool
string
(
std
::
string
&
)
bool
string
(
std
::
string
&
)
override
{
return
events_left
--
>
0
;
}
bool
start_object
(
std
::
size_t
)
bool
start_object
(
std
::
size_t
)
override
{
return
events_left
--
>
0
;
}
bool
key
(
std
::
string
&
)
bool
key
(
std
::
string
&
)
override
{
return
events_left
--
>
0
;
}
bool
end_object
()
bool
end_object
()
override
{
return
events_left
--
>
0
;
}
bool
start_array
(
std
::
size_t
)
bool
start_array
(
std
::
size_t
)
override
{
return
events_left
--
>
0
;
}
bool
end_array
()
bool
end_array
()
override
{
return
events_left
--
>
0
;
}
bool
parse_error
(
std
::
size_t
,
const
std
::
string
&
,
const
json
::
exception
&
)
bool
parse_error
(
std
::
size_t
,
const
std
::
string
&
,
const
json
::
exception
&
)
override
{
return
false
;
}
...
...
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