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
a9669a41
Commit
a9669a41
authored
Jan 04, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed "noexpect" from all functions that use new
parent
540cda61
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
src/json.cc
src/json.cc
+10
-10
src/json.h
src/json.h
+10
-10
No files found.
src/json.cc
View file @
a9669a41
...
@@ -47,7 +47,7 @@ Construct an empty JSON given the type.
...
@@ -47,7 +47,7 @@ Construct an empty JSON given the type.
@post Memory for array, object, and string are allocated.
@post Memory for array, object, and string are allocated.
*/
*/
json
::
json
(
const
value_type
t
)
noexcept
json
::
json
(
const
value_type
t
)
:
type_
(
t
)
:
type_
(
t
)
{
{
switch
(
type_
)
switch
(
type_
)
...
@@ -100,15 +100,15 @@ Construct a string JSON object.
...
@@ -100,15 +100,15 @@ Construct a string JSON object.
@param s a string to initialize the JSON object with
@param s a string to initialize the JSON object with
*/
*/
json
::
json
(
const
std
::
string
&
s
)
noexcept
json
::
json
(
const
std
::
string
&
s
)
:
type_
(
value_type
::
string
),
value_
(
new
string_t
(
s
))
:
type_
(
value_type
::
string
),
value_
(
new
string_t
(
s
))
{}
{}
json
::
json
(
std
::
string
&&
s
)
noexcept
json
::
json
(
std
::
string
&&
s
)
:
type_
(
value_type
::
string
),
value_
(
new
string_t
(
std
::
move
(
s
)))
:
type_
(
value_type
::
string
),
value_
(
new
string_t
(
std
::
move
(
s
)))
{}
{}
json
::
json
(
const
char
*
s
)
noexcept
json
::
json
(
const
char
*
s
)
:
type_
(
value_type
::
string
),
value_
(
new
string_t
(
s
))
:
type_
(
value_type
::
string
),
value_
(
new
string_t
(
s
))
{}
{}
...
@@ -124,19 +124,19 @@ json::json(const double f) noexcept
...
@@ -124,19 +124,19 @@ json::json(const double f) noexcept
:
type_
(
value_type
::
number_float
),
value_
(
f
)
:
type_
(
value_type
::
number_float
),
value_
(
f
)
{}
{}
json
::
json
(
const
array_t
&
a
)
noexcept
json
::
json
(
const
array_t
&
a
)
:
type_
(
value_type
::
array
),
value_
(
new
array_t
(
a
))
:
type_
(
value_type
::
array
),
value_
(
new
array_t
(
a
))
{}
{}
json
::
json
(
array_t
&&
a
)
noexcept
json
::
json
(
array_t
&&
a
)
:
type_
(
value_type
::
array
),
value_
(
new
array_t
(
std
::
move
(
a
)))
:
type_
(
value_type
::
array
),
value_
(
new
array_t
(
std
::
move
(
a
)))
{}
{}
json
::
json
(
const
object_t
&
o
)
noexcept
json
::
json
(
const
object_t
&
o
)
:
type_
(
value_type
::
object
),
value_
(
new
object_t
(
o
))
:
type_
(
value_type
::
object
),
value_
(
new
object_t
(
o
))
{}
{}
json
::
json
(
object_t
&&
o
)
noexcept
json
::
json
(
object_t
&&
o
)
:
type_
(
value_type
::
object
),
value_
(
new
object_t
(
std
::
move
(
o
)))
:
type_
(
value_type
::
object
),
value_
(
new
object_t
(
std
::
move
(
o
)))
{}
{}
...
@@ -155,7 +155,7 @@ as is to create an array.
...
@@ -155,7 +155,7 @@ as is to create an array.
@bug With the described approach, we would fail to recognize an array whose
@bug With the described approach, we would fail to recognize an array whose
first element is again an arrays as array.
first element is again an arrays as array.
*/
*/
json
::
json
(
list_init_t
a
)
noexcept
json
::
json
(
list_init_t
a
)
{
{
// check if each element is an array with two elements whose first element
// check if each element is an array with two elements whose first element
// is a string
// is a string
...
@@ -189,7 +189,7 @@ A copy constructor for the JSON class.
...
@@ -189,7 +189,7 @@ A copy constructor for the JSON class.
@param o the JSON object to copy
@param o the JSON object to copy
*/
*/
json
::
json
(
const
json
&
o
)
noexcept
json
::
json
(
const
json
&
o
)
:
type_
(
o
.
type_
)
:
type_
(
o
.
type_
)
{
{
switch
(
type_
)
switch
(
type_
)
...
...
src/json.h
View file @
a9669a41
...
@@ -112,17 +112,17 @@ class json
...
@@ -112,17 +112,17 @@ class json
public:
public:
/// create an object according to given type
/// create an object according to given type
json
(
const
value_type
)
noexcept
;
json
(
const
value_type
);
/// create a null object
/// create a null object
json
()
=
default
;
json
()
=
default
;
/// create a null object
/// create a null object
json
(
std
::
nullptr_t
)
noexcept
;
json
(
std
::
nullptr_t
)
noexcept
;
/// create a string object from a C++ string
/// create a string object from a C++ string
json
(
const
std
::
string
&
)
noexcept
;
json
(
const
std
::
string
&
);
/// create a string object from a C++ string (move)
/// create a string object from a C++ string (move)
json
(
std
::
string
&&
)
noexcept
;
json
(
std
::
string
&&
);
/// create a string object from a C string
/// create a string object from a C string
json
(
const
char
*
)
noexcept
;
json
(
const
char
*
);
/// create a Boolean object
/// create a Boolean object
json
(
const
bool
)
noexcept
;
json
(
const
bool
)
noexcept
;
/// create a number object
/// create a number object
...
@@ -130,18 +130,18 @@ class json
...
@@ -130,18 +130,18 @@ class json
/// create a number object
/// create a number object
json
(
const
double
)
noexcept
;
json
(
const
double
)
noexcept
;
/// create an array
/// create an array
json
(
const
array_t
&
)
noexcept
;
json
(
const
array_t
&
);
/// create an array (move)
/// create an array (move)
json
(
array_t
&&
)
noexcept
;
json
(
array_t
&&
);
/// create an object
/// create an object
json
(
const
object_t
&
)
noexcept
;
json
(
const
object_t
&
);
/// create an object (move)
/// create an object (move)
json
(
object_t
&&
)
noexcept
;
json
(
object_t
&&
);
/// create from an initializer list (to an array or object)
/// create from an initializer list (to an array or object)
json
(
list_init_t
)
noexcept
;
json
(
list_init_t
);
/// copy constructor
/// copy constructor
json
(
const
json
&
)
noexcept
;
json
(
const
json
&
);
/// move constructor
/// move constructor
json
(
json
&&
)
noexcept
;
json
(
json
&&
)
noexcept
;
...
...
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