Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
8b833c45
Commit
8b833c45
authored
Aug 24, 2016
by
Niels Lohmann
Committed by
GitHub
Aug 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
experiment: changed order of parse functions
parent
1d66ab9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
35 deletions
+35
-35
json.hpp
src/json.hpp
+35
-35
No files found.
src/json.hpp
View file @
8b833c45
...
...
@@ -5877,41 +5877,6 @@ class basic_json
/// @{
/*!
@brief deserialize from string literal
@tparam CharT character/literal type with size of 1 byte
@param[in] s string literal to read a serialized JSON value from
@param[in] cb a parser callback function of type @ref parser_callback_t
which is used to control the deserialization by filtering unwanted values
(optional)
@return result of the deserialization
@complexity Linear in the length of the input. The parser is a predictive
LL(1) parser. The complexity can be higher if the parser callback function
@a cb has a super-linear complexity.
@note A UTF-8 byte order mark is silently ignored.
@note String containers like `std::string` or @ref string_t can be parsed
with @ref parse(const ContiguousContainer&, const parser_callback_t)
@liveexample{The example below demonstrates the `parse()` function with
and without callback function.,parse__string__parser_callback_t}
@sa @ref parse(std::istream&, const parser_callback_t) for a version that
reads from an input stream
@since version 1.0.0 (originally for @ref string_t)
*/
template
<
typename
CharT
,
typename
std
::
enable_if
<
std
::
is_integral
<
CharT
>::
value
and
sizeof
(
CharT
)
==
1
,
int
>::
type
=
0
>
static
basic_json
parse
(
const
CharT
*
s
,
const
parser_callback_t
cb
=
nullptr
)
{
return
parser
(
reinterpret_cast
<
const
char
*>
(
s
),
cb
).
parse
();
}
/*!
@brief deserialize from stream
@param[in,out] i stream to read a serialized JSON value from
...
...
@@ -6074,6 +6039,41 @@ class basic_json
}
/*!
@brief deserialize from string literal
@tparam CharT character/literal type with size of 1 byte
@param[in] s string literal to read a serialized JSON value from
@param[in] cb a parser callback function of type @ref parser_callback_t
which is used to control the deserialization by filtering unwanted values
(optional)
@return result of the deserialization
@complexity Linear in the length of the input. The parser is a predictive
LL(1) parser. The complexity can be higher if the parser callback function
@a cb has a super-linear complexity.
@note A UTF-8 byte order mark is silently ignored.
@note String containers like `std::string` or @ref string_t can be parsed
with @ref parse(const ContiguousContainer&, const parser_callback_t)
@liveexample{The example below demonstrates the `parse()` function with
and without callback function.,parse__string__parser_callback_t}
@sa @ref parse(std::istream&, const parser_callback_t) for a version that
reads from an input stream
@since version 1.0.0 (originally for @ref string_t)
*/
template
<
typename
CharT
,
typename
std
::
enable_if
<
std
::
is_integral
<
CharT
>::
value
and
sizeof
(
CharT
)
==
1
,
int
>::
type
=
0
>
static
basic_json
parse
(
const
CharT
*
s
,
const
parser_callback_t
cb
=
nullptr
)
{
return
parser
(
reinterpret_cast
<
const
char
*>
(
s
),
cb
).
parse
();
}
/*!
@brief deserialize from stream
Deserializes an input stream to a JSON value.
...
...
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