summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormugisoba <51015092+mugisoba@users.noreply.github.com>2020-02-11 10:43:36 +0900
committerGitHub <noreply@github.com>2020-02-10 17:43:36 -0800
commit173e10fdf14884376eb6ed4590142394d69f62c6 (patch)
treeab138c851c87f04a604edc1a5d63db96853915f7 /include
parent8f56990f6cbb2ea260c9da3a2985568d5408d4dd (diff)
downloadflatbuffers-173e10fdf14884376eb6ed4590142394d69f62c6.tar.gz
flatbuffers-173e10fdf14884376eb6ed4590142394d69f62c6.tar.bz2
flatbuffers-173e10fdf14884376eb6ed4590142394d69f62c6.zip
[C#] support Json Serialization (#5752)
* support json serialization * fix invalid json format. * string must be written with double quotes. * remove commma after the last object member. * fix indent * Revert "fix invalid json format." This reverts commit d6820ed50c8e3d3cda3aa1849b3079f853608619. * quated string value. * add cs-gen-json-serializer flag. * fix preprocessor indent * ENABLE_JSON_SERIALIZATION -> ENABLE_JSON_SERIALIZATION_TEST * share TestBuffer method * remove ENABLE_JSON_SERIALIZATION * remove duplicated test data * [windows] add nuget restore and copy test data. * [docker mono] share msbuild settings with windows. add nuget restore and copy test data. * add some note for json api.
Diffstat (limited to 'include')
-rw-r--r--include/flatbuffers/idl.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h
index 2e2d4685..dbdacc8e 100644
--- a/include/flatbuffers/idl.h
+++ b/include/flatbuffers/idl.h
@@ -556,6 +556,7 @@ struct IDLOptions {
std::string root_type;
bool force_defaults;
bool java_primitive_has_method;
+ bool cs_gen_json_serializer;
std::vector<std::string> cpp_includes;
std::string cpp_std;
std::string proto_namespace_suffix;
@@ -592,12 +593,12 @@ struct IDLOptions {
// for code generation.
unsigned long lang_to_generate;
- // If set (default behavior), empty string fields will be set to nullptr to make
- // the flatbuffer more compact.
+ // If set (default behavior), empty string fields will be set to nullptr to
+ // make the flatbuffer more compact.
bool set_empty_strings_to_null;
- // If set (default behavior), empty vector fields will be set to nullptr to make
- // the flatbuffer more compact.
+ // If set (default behavior), empty vector fields will be set to nullptr to
+ // make the flatbuffer more compact.
bool set_empty_vectors_to_null;
IDLOptions()
@@ -641,6 +642,7 @@ struct IDLOptions {
size_prefixed(false),
force_defaults(false),
java_primitive_has_method(false),
+ cs_gen_json_serializer(false),
lang(IDLOptions::kJava),
mini_reflect(IDLOptions::kNone),
lang_to_generate(0),
@@ -1119,9 +1121,8 @@ bool GenerateJavaGRPC(const Parser &parser, const std::string &path,
// Generate GRPC Python interfaces.
// See idl_gen_grpc.cpp.
-bool GeneratePythonGRPC(const Parser &parser,
- const std::string &path,
- const std::string &file_name);
+bool GeneratePythonGRPC(const Parser &parser, const std::string &path,
+ const std::string &file_name);
} // namespace flatbuffers