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
61f03763
Commit
61f03763
authored
May 10, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more cleanup
parent
cb2102a2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
22 deletions
+18
-22
src/json.hpp
src/json.hpp
+9
-11
src/json.hpp.re2c
src/json.hpp.re2c
+9
-11
No files found.
src/json.hpp
View file @
61f03763
...
...
@@ -185,15 +185,15 @@ class basic_json
number_float_t
number_float
;
/// default constructor (for null values)
json_value
()
=
default
;
inline
json_value
()
noexcept
=
default
;
/// constructor for booleans
json_value
(
boolean_t
v
)
:
boolean
(
v
)
{}
inline
json_value
(
boolean_t
v
)
noexcept
:
boolean
(
v
)
{}
/// constructor for numbers (integer)
json_value
(
number_integer_t
v
)
:
number_integer
(
v
)
{}
inline
json_value
(
number_integer_t
v
)
noexcept
:
number_integer
(
v
)
{}
/// constructor for numbers (floating-point)
json_value
(
number_float_t
v
)
:
number_float
(
v
)
{}
inline
json_value
(
number_float_t
v
)
noexcept
:
number_float
(
v
)
{}
/// constructor for empty values of a given type
json_value
(
value_t
t
)
inline
json_value
(
value_t
t
)
{
switch
(
t
)
{
...
...
@@ -248,7 +248,7 @@ class basic_json
}
/// constructor for strings
json_value
(
const
string_t
&
value
)
inline
json_value
(
const
string_t
&
value
)
{
AllocatorType
<
string_t
>
alloc
;
string
=
alloc
.
allocate
(
1
);
...
...
@@ -256,7 +256,7 @@ class basic_json
}
/// constructor for objects
json_value
(
const
object_t
&
value
)
inline
json_value
(
const
object_t
&
value
)
{
AllocatorType
<
object_t
>
alloc
;
object
=
alloc
.
allocate
(
1
);
...
...
@@ -264,7 +264,7 @@ class basic_json
}
/// constructor for arrays
json_value
(
const
array_t
&
value
)
inline
json_value
(
const
array_t
&
value
)
{
AllocatorType
<
array_t
>
alloc
;
array
=
alloc
.
allocate
(
1
);
...
...
@@ -1187,9 +1187,7 @@ class basic_json
if
(
m_type
==
value_t
::
null
)
{
m_type
=
value_t
::
object
;
AllocatorType
<
object_t
>
alloc
;
m_value
.
object
=
alloc
.
allocate
(
1
);
alloc
.
construct
(
m_value
.
object
);
m_value
=
value_t
::
object
;
}
// at only works for objects
...
...
src/json.hpp.re2c
View file @
61f03763
...
...
@@ -185,15 +185,15 @@ class basic_json
number_float_t number_float;
/// default constructor (for null values)
json_value()
= default;
inline json_value() noexcept
= default;
/// constructor for booleans
json_value(boolean_t v)
: boolean(v) {}
inline json_value(boolean_t v) noexcept
: boolean(v) {}
/// constructor for numbers (integer)
json_value(number_integer_t v)
: number_integer(v) {}
inline json_value(number_integer_t v) noexcept
: number_integer(v) {}
/// constructor for numbers (floating-point)
json_value(number_float_t v)
: number_float(v) {}
inline json_value(number_float_t v) noexcept
: number_float(v) {}
/// constructor for empty values of a given type
json_value(value_t t)
inline
json_value(value_t t)
{
switch (t)
{
...
...
@@ -248,7 +248,7 @@ class basic_json
}
/// constructor for strings
json_value(const string_t& value)
inline
json_value(const string_t& value)
{
AllocatorType<string_t> alloc;
string = alloc.allocate(1);
...
...
@@ -256,7 +256,7 @@ class basic_json
}
/// constructor for objects
json_value(const object_t& value)
inline
json_value(const object_t& value)
{
AllocatorType<object_t> alloc;
object = alloc.allocate(1);
...
...
@@ -264,7 +264,7 @@ class basic_json
}
/// constructor for arrays
json_value(const array_t& value)
inline
json_value(const array_t& value)
{
AllocatorType<array_t> alloc;
array = alloc.allocate(1);
...
...
@@ -1187,9 +1187,7 @@ class basic_json
if (m_type == value_t::null)
{
m_type = value_t::object;
AllocatorType<object_t> alloc;
m_value.object = alloc.allocate(1);
alloc.construct(m_value.object);
m_value = value_t::object;
}
// at only works for objects
...
...
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