@@ -190,6 +190,22 @@ def export(self, dest: AsPath) -> bool:
190190 """
191191 return core .BNProjectFileExport (self ._handle , str (dest ))
192192
193+ def get_path_on_disk (self ) -> Optional [str ]:
194+ """
195+ Get this file's path on disk
196+
197+ :return: The path on disk of the file or None
198+ """
199+ return core .BNProjectFileGetPathOnDisk (self ._handle )
200+
201+ def get_path_in_project (self ) -> Optional [str ]:
202+ """
203+ Get this file's path in its parent project
204+
205+ :return: The path on disk of the file or None
206+ """
207+ return core .BNProjectFileGetPathInProject (self ._handle )
208+
193209
194210class ProjectFolder :
195211 """
@@ -650,6 +666,43 @@ def get_file_by_id(self, id: str) -> Optional[ProjectFile]:
650666 file = ProjectFile (handle )
651667 return file
652668
669+ def get_file_by_path_on_disk (self , path : str ) -> Optional [ProjectFile ]:
670+ """
671+ Retrieve a file in the project by its path on disk
672+
673+ :param path: Path of the file on the disk
674+ :return: File with the requested path or None
675+ """
676+ handle = core .BNProjectGetFileByPathOnDisk (self ._handle , path )
677+ if handle is None :
678+ return None
679+ file = ProjectFile (handle )
680+ return file
681+
682+ def get_files_by_path_in_project (self , path : str ) -> List [ProjectFile ]:
683+ """
684+ Retrieve a file(s) by path in the project
685+ Note that files in a project can share names and paths within the project
686+ but are uniquely identified by a disk path or id.
687+
688+ :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
690+ """
691+ count = ctypes .c_size_t ()
692+ value = core .BNProjectGetFilesByPathInProject (self ._handle , path , count )
693+ if value is None :
694+ raise ProjectException ("Failed to get list of project files by path in project" )
695+ result = []
696+ try :
697+ for i in range (count .value ):
698+ file_handle = core .BNNewProjectFileReference (value [i ])
699+ if file_handle is None :
700+ raise ProjectException ("core.BNNewProjectFileReference returned None" )
701+ result .append (ProjectFile (file_handle ))
702+ return result
703+ finally :
704+ core .BNFreeProjectFileList (value , count .value )
705+
653706 def delete_file (self , file : ProjectFile ) -> bool :
654707 """
655708 Delete a file from the project
0 commit comments