mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-07 05:47:36 +00:00
various fixes (#7986)
This commit is contained in:
@@ -383,6 +383,14 @@ static const char *GenerateTextImpl(const Parser &parser, const Table *table,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Generate a text representation of a flatbuffer in JSON format.
|
||||
// Deprecated: please use `GenTextFromTable`
|
||||
bool GenerateTextFromTable(const Parser &parser, const void *table,
|
||||
const std::string &table_name,
|
||||
std::string *_text) {
|
||||
return GenTextFromTable(parser, table, table_name, _text) != nullptr;
|
||||
}
|
||||
|
||||
// Generate a text representation of a flatbuffer in JSON format.
|
||||
const char *GenTextFromTable(const Parser &parser, const void *table,
|
||||
const std::string &table_name, std::string *_text) {
|
||||
@@ -392,6 +400,12 @@ const char *GenTextFromTable(const Parser &parser, const void *table,
|
||||
return GenerateTextImpl(parser, root, *struct_def, _text);
|
||||
}
|
||||
|
||||
// Deprecated: please use `GenText`
|
||||
const char *GenerateText(const Parser &parser, const void *flatbuffer,
|
||||
std::string *_text) {
|
||||
return GenText(parser, flatbuffer, _text);
|
||||
}
|
||||
|
||||
// Generate a text representation of a flatbuffer in JSON format.
|
||||
const char *GenText(const Parser &parser, const void *flatbuffer,
|
||||
std::string *_text) {
|
||||
@@ -406,6 +420,12 @@ static std::string TextFileName(const std::string &path,
|
||||
return path + file_name + ".json";
|
||||
}
|
||||
|
||||
// Deprecated: please use `GenTextFile`
|
||||
const char *GenerateTextFile(const Parser &parser, const std::string &path,
|
||||
const std::string &file_name) {
|
||||
return GenTextFile(parser, path, file_name);
|
||||
}
|
||||
|
||||
const char *GenTextFile(const Parser &parser, const std::string &path,
|
||||
const std::string &file_name) {
|
||||
if (parser.opts.use_flexbuffers) {
|
||||
|
||||
Reference in New Issue
Block a user