summaryrefslogtreecommitdiff
path: root/typelibrary.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2023-04-05 13:54:44 -0400
committerPeter LaFosse <peter@vector35.com>2023-04-18 08:43:10 -0400
commit35adefaa9d1ecf5e8c09a787dbd6bda1d1a49325 (patch)
treef4c313f35ec1ab5e0534f525b6850acc77170a82 /typelibrary.cpp
parent69e005b330a1c71978096e9f98f625e481725a14 (diff)
Add APIs for dumping the contents of TypeLibraries
Diffstat (limited to 'typelibrary.cpp')
-rw-r--r--typelibrary.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/typelibrary.cpp b/typelibrary.cpp
index 4a794805..5c81705f 100644
--- a/typelibrary.cpp
+++ b/typelibrary.cpp
@@ -14,6 +14,21 @@ TypeLibrary::TypeLibrary(Ref<Architecture> arch, const std::string& name)
}
+bool TypeLibrary::DecompressToFile(const std::string& path, const std::string& output)
+{
+ return BNTypeLibraryDecompressToFile(path.c_str(), output.c_str());
+}
+
+
+std::string TypeLibrary::Decompress(const std::string& path)
+{
+ auto str = BNTypeLibraryDecompressToString(path.c_str());
+ std::string result = str;
+ BNFreeString(str);
+ return result;
+}
+
+
Ref<TypeLibrary> TypeLibrary::LoadFromFile(const std::string& path)
{
return new TypeLibrary(BNLoadTypeLibraryFromFile(path.c_str()));