internal updating of flatbuffers

PiperOrigin-RevId: 532601578
This commit is contained in:
MediaPipe Team 2023-05-16 16:06:17 -07:00 committed by Copybara-Service
parent 609a57f167
commit 5af496201b

View File

@ -42,13 +42,13 @@ PYBIND11_MODULE(_pywrap_flatbuffers, m) {
contents.length());
});
m.def("generate_text_file", &flatbuffers::GenerateTextFile);
m.def(
"generate_text",
m.def("generate_text",
[](const flatbuffers::Parser& parser,
const std::string& buffer) -> std::string {
std::string text;
if (!flatbuffers::GenerateText(
parser, reinterpret_cast<const void*>(buffer.c_str()), &text)) {
const char* result = flatbuffers::GenerateText(
parser, reinterpret_cast<const void*>(buffer.c_str()), &text);
if (result) {
return "";
}
return text;