diff options
author | Anthony Liot <wolfviking0@yahoo.com> | 2019-04-05 11:51:29 -0700 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2019-04-05 11:51:29 -0700 |
commit | 249f3b37149daabbf4954dc8d615e97238b692b9 (patch) | |
tree | 5f2020fb1121dd5a1bf7e159a676b9dfa50c5765 /include | |
parent | 2d67de3151a3389ff0ecf1578a61db6f0a9cf028 (diff) | |
download | flatbuffers-249f3b37149daabbf4954dc8d615e97238b692b9.tar.gz flatbuffers-249f3b37149daabbf4954dc8d615e97238b692b9.tar.bz2 flatbuffers-249f3b37149daabbf4954dc8d615e97238b692b9.zip |
Add method GenerateTextFromTable issue #5249 (#5266)
* Create a function GenerateGenerateTextFromTable in order to create a json from any Table
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Update the test to failed if loadfile or parser return false
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Fix snake_case name typo + space before &/*
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* use auto
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Use clang-format on the added code
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/flatbuffers/idl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h index 05d666cb..40dfba40 100644 --- a/include/flatbuffers/idl.h +++ b/include/flatbuffers/idl.h @@ -834,6 +834,10 @@ extern std::string MakeCamel(const std::string &in, bool first = true); // strict_json adds "quotes" around field names if true. // If the flatbuffer cannot be encoded in JSON (e.g., it contains non-UTF-8 // byte arrays in String values), returns false. +extern bool GenerateTextFromTable(const Parser &parser, + const void *table, + const std::string &tablename, + std::string *text); extern bool GenerateText(const Parser &parser, const void *flatbuffer, std::string *text); |