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
9cfb777b
Commit
9cfb777b
authored
Mar 11, 2017
by
Ted Lyngmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix -Weffc++ warnings (GNU 6.3.1)
parent
758c4add
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
336 additions
and
840 deletions
+336
-840
src/json.hpp
src/json.hpp
+308
-840
src/json.hpp.re2c
src/json.hpp.re2c
+15
-0
test/src/unit-udt.cpp
test/src/unit-udt.cpp
+13
-0
No files found.
src/json.hpp
View file @
9cfb777b
This diff is collapsed.
Click to expand it.
src/json.hpp.re2c
View file @
9cfb777b
...
...
@@ -6168,6 +6168,21 @@ class basic_json
thousands_sep(!loc->thousands_sep ? '\0' : loc->thousands_sep[0]),
decimal_point(!loc->decimal_point ? '\0' : loc->decimal_point[0])
{}
serializer(const serializer& cpy)
: o(cpy.o),
thousands_sep(cpy.thousands_sep),
decimal_point(cpy.decimal_point),
loc(cpy.loc),
indent_string(cpy.indent_string)
{}
serializer& operator=(const serializer& rhs) {
o = rhs.o;
thousands_sep = rhs.thousands_sep;
decimal_point = rhs.decimal_point;
loc = rhs.loc;
indent_string = rhs.indent_string;
return *this;
}
/*!
@brief internal implementation of the serialization function
...
...
test/src/unit-udt.cpp
View file @
9cfb777b
...
...
@@ -49,16 +49,19 @@ enum class country
struct
age
{
int
m_val
;
age
(
int
rhs
=
0
)
:
m_val
(
rhs
)
{}
};
struct
name
{
std
::
string
m_val
;
name
(
const
std
::
string
rhs
=
""
)
:
m_val
(
rhs
)
{}
};
struct
address
{
std
::
string
m_val
;
address
(
const
std
::
string
rhs
=
""
)
:
m_val
(
rhs
)
{}
};
struct
person
...
...
@@ -66,18 +69,24 @@ struct person
age
m_age
;
name
m_name
;
country
m_country
;
person
()
:
m_age
(),
m_name
(),
m_country
()
{}
person
(
const
age
&
a
,
const
name
&
n
,
const
country
&
c
)
:
m_age
(
a
),
m_name
(
n
),
m_country
(
c
)
{}
};
struct
contact
{
person
m_person
;
address
m_address
;
contact
()
:
m_person
(),
m_address
()
{}
contact
(
const
person
&
p
,
const
address
&
a
)
:
m_person
(
p
),
m_address
(
a
)
{}
};
struct
contact_book
{
name
m_book_name
;
std
::
vector
<
contact
>
m_contacts
;
contact_book
()
:
m_book_name
(),
m_contacts
()
{}
contact_book
(
const
name
&
n
,
const
std
::
vector
<
contact
>&
c
)
:
m_book_name
(
n
),
m_contacts
(
c
)
{}
};
}
...
...
@@ -319,6 +328,8 @@ namespace udt
struct
legacy_type
{
std
::
string
number
;
legacy_type
()
:
number
()
{}
legacy_type
(
const
std
::
string
&
n
)
:
number
(
n
)
{}
};
}
...
...
@@ -593,6 +604,8 @@ struct small_pod
struct
non_pod
{
std
::
string
s
;
non_pod
()
:
s
()
{}
non_pod
(
const
std
::
string
&
S
)
:
s
(
S
)
{}
};
template
<
typename
BasicJsonType
>
...
...
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