Skip to content

Commit 19c6c1d

Browse files
committed
Add GetSystemCacheDirectory to C++ API
1 parent 5905230 commit 19c6c1d

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

binaryninjaapi.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ string BinaryNinja::GetUserDirectory(void)
9595
}
9696

9797

98+
string BinaryNinja::GetSystemCacheDirectory()
99+
{
100+
char* dir = BNGetSystemCacheDirectory();
101+
if (!dir)
102+
return string();
103+
std::string result(dir);
104+
BNFreeString(dir);
105+
return result;
106+
}
107+
108+
98109
string BinaryNinja::GetSettingsFileName()
99110
{
100111
char* dir = BNGetSettingsFileName();

binaryninjaapi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,8 @@ namespace BinaryNinja {
12411241
void SetBundledPluginDirectory(const std::string& path);
12421242
std::string GetUserDirectory();
12431243

1244+
std::string GetSystemCacheDirectory();
1245+
12441246
std::string GetSettingsFileName();
12451247
std::string GetRepositoriesDirectory();
12461248
std::string GetInstallDirectory();

binaryninjacore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7512,6 +7512,7 @@ extern "C"
75127512
BINARYNINJACOREAPI char** BNGetFilePathsInDirectory(const char* path, size_t* count);
75137513
BINARYNINJACOREAPI char* BNAppendPath(const char* path, const char* part);
75147514
BINARYNINJACOREAPI void BNFreePath(char* path);
7515+
BINARYNINJACOREAPI char* BNGetSystemCacheDirectory();
75157516

75167517
// Settings APIs
75177518
BINARYNINJACOREAPI BNSettings* BNCreateSettings(const char* schemaId);

0 commit comments

Comments
 (0)