Recursively create files and folders in the project from a path on disk `parent` - Parent folder in the project that will contain the new folder `name` - Name for the created folder `description` - Description for created folder `id` - id unique ID
(
&self,
parent: Option<&ProjectFolder>,
name: N,
description: D,
id: I,
)
| 253 | /// * `description` - Description for created folder |
| 254 | /// * `id` - id unique ID |
| 255 | pub unsafe fn create_folder_unsafe<N, D, I>( |
| 256 | &self, |
| 257 | parent: Option<&ProjectFolder>, |
| 258 | name: N, |
| 259 | description: D, |
| 260 | id: I, |
| 261 | ) -> Result<Ref<ProjectFolder>, ()> |
| 262 | where |
| 263 | N: BnStrCompatible, |
| 264 | D: BnStrCompatible, |
| 265 | I: BnStrCompatible, |
| 266 | { |
| 267 | let name_raw = name.into_bytes_with_nul(); |
| 268 | let description_raw = description.into_bytes_with_nul(); |
| 269 | let parent_ptr = parent.map(|p| p.handle.as_ptr()).unwrap_or(null_mut()); |
| 270 | let id_raw = id.into_bytes_with_nul(); |
| 271 | unsafe { |
| 272 | let result = BNProjectCreateFolderUnsafe( |
| 273 | self.handle.as_ptr(), |
| 274 | parent_ptr, |
| 275 | name_raw.as_ref().as_ptr() as *const c_char, |
| 276 | description_raw.as_ref().as_ptr() as *const c_char, |
| 277 | id_raw.as_ref().as_ptr() as *const c_char, |
| 278 | ); |
| 279 | Ok(ProjectFolder::ref_from_raw(NonNull::new(result).ok_or(())?)) |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | /// Get a list of folders in the project |
| 284 | pub fn folders(&self) -> Result<Array<ProjectFolder>, ()> { |