Retrieve a file in the project by the `path` on disk
(&self, path: S)
| 646 | |
| 647 | /// Retrieve a file in the project by the `path` on disk |
| 648 | pub fn file_by_path<S: BnStrCompatible>(&self, path: S) -> Option<Ref<ProjectFile>> { |
| 649 | let path_raw = path.into_bytes_with_nul(); |
| 650 | let path_ptr = path_raw.as_ref().as_ptr() as *const c_char; |
| 651 | |
| 652 | let result = unsafe { BNProjectGetFileByPathOnDisk(self.handle.as_ptr(), path_ptr) }; |
| 653 | let handle = NonNull::new(result)?; |
| 654 | Some(unsafe { ProjectFile::ref_from_raw(handle) }) |
| 655 | } |
| 656 | |
| 657 | /// Delete a file from the project |
| 658 | pub fn delete_file(&self, file: &ProjectFile) -> bool { |