Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alexander Lapshin
common
Commits
a44bef54
Commit
a44bef54
authored
Jan 16, 2020
by
Alexander Lapshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0969b9b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
json_functions.h
json/json_functions.h
+15
-0
No files found.
json/json_functions.h
View file @
a44bef54
...
...
@@ -484,6 +484,21 @@ void PutValue(jsonalloc& alc, jsonval& ss, const std::string conName, const std:
ss
.
AddMember
(
jname
,
jsvec
,
alc
);
}
template
<
typename
T
,
typename
TK
>
void
PutMapAsVec
(
jsonalloc
&
alc
,
jsonval
&
ss
,
const
std
::
string
conName
,
const
std
::
map
<
TK
,
T
>&
vec
,
bool
(
*
f
)(
rapidjson
::
Document
::
AllocatorType
&
,
jsonval
&
,
const
T
&
))
{
jsonval
jsvec
(
rapidjson
::
kArrayType
);
for
(
typename
std
::
map
<
TK
,
T
>::
const_iterator
it
=
vec
.
begin
();
it
!=
vec
.
end
();
++
it
)
{
jsonval
child
(
rapidjson
::
kObjectType
);
if
(
f
(
alc
,
child
,
it
->
second
))
{
jsvec
.
PushBack
(
child
,
alc
);
}
}
jsonval
jname
(
conName
,
alc
);
ss
.
AddMember
(
jname
,
jsvec
,
alc
);
}
inline
void
PutValue
(
jsonalloc
&
alc
,
jsonval
&
ss
,
const
std
::
string
&
conName
,
const
std
::
vector
<
size_t
>&
vec
)
{
jsonval
jsvec
(
rapidjson
::
kArrayType
);
...
...
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