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
46474010
Commit
46474010
authored
Jan 06, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed #15
parent
bd9f49ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
json.cc
src/json.cc
+4
-4
json.h
src/json.h
+3
-3
No files found.
src/json.cc
View file @
46474010
...
...
@@ -300,7 +300,7 @@ json json::parse(const char* s)
}
const
std
::
string
json
::
type_name
()
const
noexcept
std
::
string
json
::
type_name
()
const
noexcept
{
switch
(
type_
)
{
...
...
@@ -479,8 +479,8 @@ Internal implementation of the serialization function.
\param indentStep the indent level
\param currentIndent the current indent level (only used internally)
*/
const
std
::
string
json
::
dump
(
const
bool
prettyPrint
,
const
unsigned
int
indentStep
,
unsigned
int
currentIndent
)
const
noexcept
std
::
string
json
::
dump
(
const
bool
prettyPrint
,
const
unsigned
int
indentStep
,
unsigned
int
currentIndent
)
const
noexcept
{
// helper function to return whitespace as indentation
const
auto
indent
=
[
prettyPrint
,
&
currentIndent
]()
...
...
@@ -600,7 +600,7 @@ Serialization function for JSON objects. The function tries to mimick Python's
\see https://docs.python.org/2/library/json.html#json.dump
*/
const
std
::
string
json
::
dump
(
int
indent
)
const
noexcept
std
::
string
json
::
dump
(
int
indent
)
const
noexcept
{
if
(
indent
>=
0
)
{
...
...
src/json.h
View file @
46474010
...
...
@@ -160,10 +160,10 @@ class json
private
:
/// return the type as string
const
std
::
string
type_name
()
const
noexcept
;
std
::
string
type_name
()
const
noexcept
;
/// dump the object (with pretty printer)
const
std
::
string
dump
(
const
bool
,
const
unsigned
int
,
unsigned
int
=
0
)
const
noexcept
;
std
::
string
dump
(
const
bool
,
const
unsigned
int
,
unsigned
int
=
0
)
const
noexcept
;
public
:
/// explicit value conversion
...
...
@@ -210,7 +210,7 @@ class json
}
/// explicit serialization
const
std
::
string
dump
(
int
=
-
1
)
const
noexcept
;
std
::
string
dump
(
int
=
-
1
)
const
noexcept
;
/// add an object/array to an array
json
&
operator
+=
(
const
json
&
);
...
...
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