Recursively create files and folders in the project from a path on disk `path` - Path to folder on disk `parent` - Parent folder in the project that will contain the new contents `description` - Description for created root folder `progress` - [`ProgressCallback`] that will be called as the [`ProjectFolder`] is being created
(
&self,
path: P,
parent: Option<&ProjectFolder>,
description: D,
mut progress: PC,
)
| 189 | /// * `description` - Description for created root folder |
| 190 | /// * `progress` - [`ProgressCallback`] that will be called as the [`ProjectFolder`] is being created |
| 191 | pub fn create_folder_from_path_with_progress<P, D, PC>( |
| 192 | &self, |
| 193 | path: P, |
| 194 | parent: Option<&ProjectFolder>, |
| 195 | description: D, |
| 196 | mut progress: PC, |
| 197 | ) -> Result<Ref<ProjectFolder>, ()> |
| 198 | where |
| 199 | P: BnStrCompatible, |
| 200 | D: BnStrCompatible, |
| 201 | PC: ProgressCallback, |
| 202 | { |
| 203 | let path_raw = path.into_bytes_with_nul(); |
| 204 | let description_raw = description.into_bytes_with_nul(); |
| 205 | let parent_ptr = parent.map(|p| p.handle.as_ptr()).unwrap_or(null_mut()); |
| 206 | |
| 207 | unsafe { |
| 208 | let result = BNProjectCreateFolderFromPath( |
| 209 | self.handle.as_ptr(), |
| 210 | path_raw.as_ref().as_ptr() as *const c_char, |
| 211 | parent_ptr, |
| 212 | description_raw.as_ref().as_ptr() as *const c_char, |
| 213 | &mut progress as *mut PC as *mut c_void, |
| 214 | Some(PC::cb_progress_callback), |
| 215 | ); |
| 216 | Ok(ProjectFolder::ref_from_raw(NonNull::new(result).ok_or(())?)) |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | /// Recursively create files and folders in the project from a path on disk |
| 221 | /// |