internal updating of flatbuffers
PiperOrigin-RevId: 532601578
This commit is contained in:
parent
609a57f167
commit
5af496201b
|
@ -42,17 +42,17 @@ PYBIND11_MODULE(_pywrap_flatbuffers, m) {
|
||||||
contents.length());
|
contents.length());
|
||||||
});
|
});
|
||||||
m.def("generate_text_file", &flatbuffers::GenerateTextFile);
|
m.def("generate_text_file", &flatbuffers::GenerateTextFile);
|
||||||
m.def(
|
m.def("generate_text",
|
||||||
"generate_text",
|
[](const flatbuffers::Parser& parser,
|
||||||
[](const flatbuffers::Parser& parser,
|
const std::string& buffer) -> std::string {
|
||||||
const std::string& buffer) -> std::string {
|
std::string text;
|
||||||
std::string text;
|
const char* result = flatbuffers::GenerateText(
|
||||||
if (!flatbuffers::GenerateText(
|
parser, reinterpret_cast<const void*>(buffer.c_str()), &text);
|
||||||
parser, reinterpret_cast<const void*>(buffer.c_str()), &text)) {
|
if (result) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace support
|
} // namespace support
|
||||||
|
|
Loading…
Reference in New Issue
Block a user