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
f1e61896
Commit
f1e61896
authored
May 11, 2016
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed a shadow error
parent
db5c9ec9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/json.hpp
src/json.hpp
+3
-3
src/json.hpp.re2c
src/json.hpp.re2c
+3
-3
No files found.
src/json.hpp
View file @
f1e61896
...
@@ -9659,7 +9659,7 @@ basic_json_parser_63:
...
@@ -9659,7 +9659,7 @@ basic_json_parser_63:
@since version 2.0.0
@since version 2.0.0
*/
*/
basic_json
patch
(
const
basic_json
&
patch
)
const
basic_json
patch
(
const
basic_json
&
json_
patch
)
const
{
{
// make a working copy to apply the patch to
// make a working copy to apply the patch to
basic_json
result
=
*
this
;
basic_json
result
=
*
this
;
...
@@ -9790,14 +9790,14 @@ basic_json_parser_63:
...
@@ -9790,14 +9790,14 @@ basic_json_parser_63:
};
};
// type check
// type check
if
(
not
patch
.
is_array
())
if
(
not
json_
patch
.
is_array
())
{
{
// a JSON patch must be an array of objects
// a JSON patch must be an array of objects
throw
std
::
invalid_argument
(
"JSON patch must be an array of objects"
);
throw
std
::
invalid_argument
(
"JSON patch must be an array of objects"
);
}
}
// iterate and apply th eoperations
// iterate and apply th eoperations
for
(
const
auto
&
val
:
patch
)
for
(
const
auto
&
val
:
json_
patch
)
{
{
// wrapper to get a value for an operation
// wrapper to get a value for an operation
const
auto
get_value
=
[
&
val
](
const
std
::
string
&
op
,
const
auto
get_value
=
[
&
val
](
const
std
::
string
&
op
,
...
...
src/json.hpp.re2c
View file @
f1e61896
...
@@ -8969,7 +8969,7 @@ class basic_json
...
@@ -8969,7 +8969,7 @@ class basic_json
@since version 2.0.0
@since version 2.0.0
*/
*/
basic_json patch(const basic_json& patch) const
basic_json patch(const basic_json&
json_
patch) const
{
{
// make a working copy to apply the patch to
// make a working copy to apply the patch to
basic_json result = *this;
basic_json result = *this;
...
@@ -9100,14 +9100,14 @@ class basic_json
...
@@ -9100,14 +9100,14 @@ class basic_json
};
};
// type check
// type check
if (not patch.is_array())
if (not
json_
patch.is_array())
{
{
// a JSON patch must be an array of objects
// a JSON patch must be an array of objects
throw std::invalid_argument("JSON patch must be an array of objects");
throw std::invalid_argument("JSON patch must be an array of objects");
}
}
// iterate and apply th eoperations
// iterate and apply th eoperations
for (const auto& val : patch)
for (const auto& val :
json_
patch)
{
{
// wrapper to get a value for an operation
// wrapper to get a value for an operation
const auto get_value = [&val](const std::string & op,
const auto get_value = [&val](const std::string & op,
...
...
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