Skip to content

Commit df4cb16

Browse files
committed
Pluralize GetFilesByPathInProject and get_files_by_path_in_project
1 parent 8f930be commit df4cb16

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
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
@@ -4013,7 +4013,7 @@ extern "C"
40134013
BINARYNINJACOREAPI BNProjectFile** BNProjectGetFiles(BNProject* project, size_t* count);
40144014
BINARYNINJACOREAPI BNProjectFile* BNProjectGetFileById(BNProject* project, const char* id);
40154015
BINARYNINJACOREAPI BNProjectFile* BNProjectGetFileByPathOnDisk(BNProject* project, const char* path);
4016-
BINARYNINJACOREAPI BNProjectFile** BNProjectGetFileByPathInProject(BNProject* project, const char* path, size_t* count);
4016+
BINARYNINJACOREAPI BNProjectFile** BNProjectGetFilesByPathInProject(BNProject* project, const char* path, size_t* count);
40174017

40184018
BINARYNINJACOREAPI void BNProjectPushFile(BNProject* project, BNProjectFile* file);
40194019
BINARYNINJACOREAPI bool BNProjectDeleteFile(BNProject* project, BNProjectFile* file);
@@ -4038,7 +4038,7 @@ extern "C"
40384038
BINARYNINJACOREAPI void BNFreeProjectFile(BNProjectFile* file);
40394039
BINARYNINJACOREAPI void BNFreeProjectFileList(BNProjectFile** files, size_t count);
40404040
BINARYNINJACOREAPI char* BNProjectFileGetPathOnDisk(BNProjectFile* file);
4041-
BINARYNINJACOREAPI char* BNProjectFileGetPathInProject(BNProjectFile* file);
4041+
BINARYNINJACOREAPI char* BNProjectFileGetPathInProject(const BNProjectFile* file);
40424042
BINARYNINJACOREAPI bool BNProjectFileExistsOnDisk(BNProjectFile* file);
40434043
BINARYNINJACOREAPI char* BNProjectFileGetName(BNProjectFile* file);
40444044
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 = []

rust/tests/binary_view.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ fn test_binary_tags() {
106106
let view = binaryninja::load(out_dir.join("atox.obj")).expect("Failed to create view");
107107
let tag_ty = view.create_tag_type("Test", "");
108108
view.add_tag(0x0, &tag_ty, "t", false);
109-
view.tag_type_by_name("Test").expect("Failed to get tag type");
109+
view.tag_type_by_name("Test")
110+
.expect("Failed to get tag type");
110111
}
111112

112113
// These are the target files present in OUT_DIR

0 commit comments

Comments
 (0)