Deserializes binary flatbuffer data to a JSON file. Args: output_dir: Directory under which to create the JSON file. schema_path: Path to the flatbuffer schema to use for deserialization. If the schema inclues other schema files, they must be present in t
(
output_dir: str,
schema_path: str,
bin_path: str,
flatc_additional_args: Optional[List[str]] = None,
)
| 353 | |
| 354 | |
| 355 | def _flatc_decompile( |
| 356 | output_dir: str, |
| 357 | schema_path: str, |
| 358 | bin_path: str, |
| 359 | flatc_additional_args: Optional[List[str]] = None, |
| 360 | ) -> None: |
| 361 | """Deserializes binary flatbuffer data to a JSON file. |
| 362 | |
| 363 | Args: |
| 364 | output_dir: Directory under which to create the JSON file. |
| 365 | schema_path: Path to the flatbuffer schema to use for deserialization. |
| 366 | If the schema inclues other schema files, they must be present in |
| 367 | the same directory. |
| 368 | bin_path: Path to the data to deserialize, as binary data compatible |
| 369 | with the schema. |
| 370 | """ |
| 371 | flatc_additional_args = flatc_additional_args if flatc_additional_args else [] |
| 372 | _run_flatc( |
| 373 | flatc_additional_args |
| 374 | + [ |
| 375 | "--json", |
| 376 | "--defaults-json", |
| 377 | "--strict-json", |
| 378 | "-o", |
| 379 | output_dir, |
| 380 | schema_path, |
| 381 | "--", |
| 382 | bin_path, |
| 383 | ] |
| 384 | ) |
| 385 | |
| 386 | |
| 387 | def _program_json_to_flatbuffer( |
no test coverage detected