diff options
| author | Mason Reed <mason@vector35.com> | 2026-02-17 20:11:39 -0800 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-02-23 00:09:44 -0800 |
| commit | b765ffd736ecbfbb7c19b7e166a021ac46a9eeb8 (patch) | |
| tree | 674f5aaa6a8541e29a407511f1db37e07074e436 /rust | |
| parent | c980b77666bba9e4480c44de72cc8de0ca10c8e4 (diff) | |
[BNTL] Allow decompressing standalone TypeLibrary objects
Previously you must have written the type library to disk
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/src/types/library.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/rust/src/types/library.rs b/rust/src/types/library.rs index d75ee612..3dd353f7 100644 --- a/rust/src/types/library.rs +++ b/rust/src/types/library.rs @@ -70,13 +70,6 @@ impl TypeLibrary { unsafe { Array::new(result, count, ()) } } - /// Decompresses a type library file to a JSON file at the given `output_path`. - pub fn decompress_to_file(path: &Path, output_path: &Path) -> bool { - let path = path.to_cstr(); - let output = output_path.to_cstr(); - unsafe { BNTypeLibraryDecompressToFile(path.as_ptr(), output.as_ptr()) } - } - /// Loads a finalized type library instance from the given `path`. /// /// The returned type library cannot be modified. @@ -94,6 +87,12 @@ impl TypeLibrary { unsafe { BNWriteTypeLibraryToFile(self.as_raw(), path.as_ptr()) } } + /// Decompresses the type library file to a JSON file at the given `output_path`. + pub fn decompress_to_file(&self, output_path: &Path) -> bool { + let path = output_path.to_cstr(); + unsafe { BNTypeLibraryDecompressToFile(self.handle.as_ptr(), path.as_ptr()) } + } + /// Looks up the first type library found with a matching name. Keep in mind that names are not /// necessarily unique. /// |
