Skip to content

Commit 78ae7be

Browse files
committed
Pluralize GetFilesByPathInProject and get_files_by_path_in_project
1 parent cf5c987 commit 78ae7be

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

binaryninjaapi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2939,7 +2939,7 @@ namespace BinaryNinja {
29392939
std::vector<Ref<ProjectFile>> GetFiles() const;
29402940
Ref<ProjectFile> GetFileById(const std::string& id) const;
29412941
Ref<ProjectFile> GetFileByPathOnDisk(const std::string& path) const;
2942-
std::vector<Ref<ProjectFile>> GetFileByPathInProject(const std::string& path) const;
2942+
std::vector<Ref<ProjectFile>> GetFilesByPathInProject(const std::string& path) const;
29432943
void PushFile(Ref<ProjectFile> file);
29442944
bool DeleteFile_(Ref<ProjectFile> file);
29452945

binaryninjacore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3994,7 +3994,7 @@ extern "C"
39943994
BINARYNINJACOREAPI BNProjectFile** BNProjectGetFiles(BNProject* project, size_t* count);
39953995
BINARYNINJACOREAPI BNProjectFile* BNProjectGetFileById(BNProject* project, const char* id);
39963996
BINARYNINJACOREAPI BNProjectFile* BNProjectGetFileByPathOnDisk(BNProject* project, const char* path);
3997-
BINARYNINJACOREAPI BNProjectFile** BNProjectGetFileByPathInProject(BNProject* project, const char* path, size_t* count);
3997+
BINARYNINJACOREAPI BNProjectFile** BNProjectGetFilesByPathInProject(BNProject* project, const char* path, size_t* count);
39983998

39993999
BINARYNINJACOREAPI void BNProjectPushFile(BNProject* project, BNProjectFile* file);
40004000
BINARYNINJACOREAPI bool BNProjectDeleteFile(BNProject* project, BNProjectFile* file);
@@ -4019,7 +4019,7 @@ extern "C"
40194019
BINARYNINJACOREAPI void BNFreeProjectFile(BNProjectFile* file);
40204020
BINARYNINJACOREAPI void BNFreeProjectFileList(BNProjectFile** files, size_t count);
40214021
BINARYNINJACOREAPI char* BNProjectFileGetPathOnDisk(BNProjectFile* file);
4022-
BINARYNINJACOREAPI char* BNProjectFileGetPathInProject(BNProjectFile* file);
4022+
BINARYNINJACOREAPI char* BNProjectFileGetPathInProject(const BNProjectFile* file);
40234023
BINARYNINJACOREAPI bool BNProjectFileExistsOnDisk(BNProjectFile* file);
40244024
BINARYNINJACOREAPI char* BNProjectFileGetName(BNProjectFile* file);
40254025
BINARYNINJACOREAPI bool BNProjectFileSetName(BNProjectFile* file, const char* name);

project.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,12 +486,12 @@ Ref<ProjectFile> Project::GetFileByPathOnDisk(const std::string& path) const
486486
}
487487

488488

489-
std::vector<Ref<ProjectFile>> Project::GetFileByPathInProject(
489+
std::vector<Ref<ProjectFile>> Project::GetFilesByPathInProject(
490490
const std::string& path
491491
) const
492492
{
493493
size_t count;
494-
BNProjectFile** files = BNProjectGetFileByPathInProject(m_object, path.c_str(), &count);
494+
BNProjectFile** files = BNProjectGetFilesByPathInProject(m_object, path.c_str(), &count);
495495

496496
std::vector<Ref<ProjectFile>> result;
497497
result.reserve(count);

python/project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,17 +679,17 @@ def get_file_by_path_on_disk(self, path: str) -> Optional[ProjectFile]:
679679
file = ProjectFile(handle)
680680
return file
681681

682-
def get_file_by_path_in_project(self, path: str) -> Optional[List[ProjectFile]]:
682+
def get_files_by_path_in_project(self, path: str) -> List[ProjectFile]:
683683
"""
684684
Retrieve a file(s) by path in the project
685685
Note that files in a project can share names and paths within the project
686686
but are uniquely identified by a disk path or id.
687687
688688
:param path: Path of the file(s) in the project, separate from their path on disk.
689-
:return: List of files with the requested path or None
689+
:return: List of files with the requested path
690690
"""
691691
count = ctypes.c_size_t()
692-
value = core.BNProjectGetFileByPathInProject(self._handle, path, count)
692+
value = core.BNProjectGetFilesByPathInProject(self._handle, path, count)
693693
if value is None:
694694
raise ProjectException("Failed to get list of project files by path in project")
695695
result = []

0 commit comments

Comments
 (0)