diff options
| -rw-r--r-- | binaryninjaapi.h | 1 | ||||
| -rw-r--r-- | binaryninjacore.h | 1 | ||||
| -rw-r--r-- | project.cpp | 9 |
3 files changed, 11 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 32d6051f..93117eb8 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -3694,6 +3694,7 @@ namespace BinaryNinja { std::string GetId() const; bool IsOpen() const; std::string GetPath() const; + std::string GetFilePathInProject(const Ref<ProjectFile>& file) const; std::string GetName() const; void SetName(const std::string& name); std::string GetDescription() const; diff --git a/binaryninjacore.h b/binaryninjacore.h index b7f9e63a..ae935420 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -4039,6 +4039,7 @@ extern "C" BINARYNINJACOREAPI char* BNProjectGetId(BNProject* project); BINARYNINJACOREAPI bool BNProjectIsOpen(BNProject* project); BINARYNINJACOREAPI char* BNProjectGetPath(BNProject* project); + BINARYNINJACOREAPI char* BNProjectGetFilePathInProject(BNProject* project, BNProjectFile* file); BINARYNINJACOREAPI char* BNProjectGetName(BNProject* project); BINARYNINJACOREAPI void BNProjectSetName(BNProject* project, const char* name); BINARYNINJACOREAPI char* BNProjectGetDescription(BNProject* project); diff --git a/project.cpp b/project.cpp index e795db61..e3e2b923 100644 --- a/project.cpp +++ b/project.cpp @@ -285,6 +285,15 @@ std::string Project::GetPath() const return result; } +std::string Project::GetFilePathInProject(const Ref<ProjectFile>& file) const +{ + char* path = BNProjectGetFilePathInProject(m_object, file->m_object); + std::string result = path; + BNFreeString(path); + return result; +} + + std::string Project::GetName() const { |
