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
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
35 deletions
+35
-35
src/json.hpp
src/json.hpp
+35
-35
No files found.
src/json.hpp
View file @
8b833c45
...
@@ -5876,41 +5876,6 @@ class basic_json
...
@@ -5876,41 +5876,6 @@ class basic_json
/// @name deserialization
/// @name deserialization
/// @{
/// @{
/*!
@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
@brief deserialize from stream
...
@@ -6073,6 +6038,41 @@ class basic_json
...
@@ -6073,6 +6038,41 @@ class basic_json
return
parse
(
std
::
begin
(
c
),
std
::
end
(
c
),
cb
);
return
parse
(
std
::
begin
(
c
),
std
::
end
(
c
),
cb
);
}
}
/*!
@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
@brief deserialize from stream
...
...
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