mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-08 14:15:17 +00:00
Rename GenerateText
to make it a compile-time breaking change, to alert any users to the new meaning of the return value
This commit is contained in:
@@ -1210,14 +1210,14 @@ class Parser : public ParserState {
|
||||
// if it is less than 0, no linefeeds will be generated either.
|
||||
// See idl_gen_text.cpp.
|
||||
// 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 const char *GenerateTextFromTable(const Parser &parser,
|
||||
const void *table,
|
||||
const std::string &tablename,
|
||||
std::string *text);
|
||||
extern const char *GenerateText(const Parser &parser, const void *flatbuffer,
|
||||
std::string *text);
|
||||
// These functions return nullptr on success, or an error string,
|
||||
// which may happen if the flatbuffer cannot be encoded in JSON (e.g.,
|
||||
// it contains non-UTF-8 byte arrays in String values).
|
||||
extern const char *GenTextFromTable(const Parser &parser, const void *table,
|
||||
const std::string &tablename,
|
||||
std::string *text);
|
||||
extern const char *GenText(const Parser &parser, const void *flatbuffer,
|
||||
std::string *text);
|
||||
|
||||
// Generate GRPC Cpp interfaces.
|
||||
// See idl_gen_grpc.cpp.
|
||||
|
||||
@@ -52,7 +52,7 @@ class Registry {
|
||||
Parser parser;
|
||||
if (!LoadSchema(ident, &parser)) return false;
|
||||
// Now we're ready to generate text.
|
||||
auto err = GenerateText(parser, flatbuf, dest);
|
||||
auto err = GenText(parser, flatbuf, dest);
|
||||
if (err) {
|
||||
lasterror_ =
|
||||
"unable to generate text for FlatBuffer binary: " + std::string(err);
|
||||
|
||||
@@ -623,7 +623,7 @@ inline bool EscapeString(const char *s, size_t length, std::string *_text,
|
||||
// we previously checked for non-UTF-8, so we shouldn't reach
|
||||
// here.
|
||||
//
|
||||
// 2) We reached here by someone calling GenerateText()
|
||||
// 2) We reached here by someone calling GenText()
|
||||
// on a previously-serialized flatbuffer. The data might have
|
||||
// non-UTF-8 Strings, or might be corrupt.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user