Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
5de28c74
Commit
5de28c74
authored
Sep 08, 2015
by
Björn Reimer
Committed by
Wouter van Oortmerssen
Sep 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serialize boolean in JSON to "true/false" instead of "0/1"
Change-Id: I90cf519c00eaf9ccd9fcab8035a91b9205587c3b
parent
44261ccd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
idl_gen_text.cpp
src/idl_gen_text.cpp
+6
-1
test.cpp
tests/test.cpp
+5
-0
No files found.
src/idl_gen_text.cpp
View file @
5de28c74
...
...
@@ -60,7 +60,12 @@ template<typename T> void Print(T val, Type type, int /*indent*/,
return
;
}
}
text
+=
NumToString
(
val
);
if
(
type
.
base_type
==
BASE_TYPE_BOOL
)
{
text
+=
val
?
"true"
:
"false"
;
}
else
{
text
+=
NumToString
(
val
);
}
}
// Print a vector a sequence of JSON values, comma separated, wrapped in "[]".
...
...
tests/test.cpp
View file @
5de28c74
...
...
@@ -635,6 +635,11 @@ void FuzzTest2() {
Dummy
();
}
break
;
case
flatbuffers
:
:
BASE_TYPE_BOOL
:
AddToSchemaAndInstances
(
"bool"
,
deprecated
?
""
:
(
lcg_rand
()
%
2
?
"true"
:
"false"
));
break
;
default
:
// All the scalar types.
schema
+=
flatbuffers
::
kTypeNames
[
base_type
];
...
...
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