Get the list of files in this project. NOTE: If the project has not been opened, it will be opened upon calling this. NOTE: If folders have not been pulled, they will be pulled upon calling this. NOTE: If files have not been pulled, they will be pulled upon calling this.
(&self)
| 214 | /// NOTE: If folders have not been pulled, they will be pulled upon calling this. |
| 215 | /// NOTE: If files have not been pulled, they will be pulled upon calling this. |
| 216 | pub fn files(&self) -> Result<Array<RemoteFile>, ()> { |
| 217 | // TODO: This sync should be removed? |
| 218 | if !self.has_pulled_files() { |
| 219 | self.pull_files()?; |
| 220 | } |
| 221 | |
| 222 | let mut count = 0; |
| 223 | let result = unsafe { BNRemoteProjectGetFiles(self.handle.as_ptr(), &mut count) }; |
| 224 | (!result.is_null()) |
| 225 | .then(|| unsafe { Array::new(result, count, ()) }) |
| 226 | .ok_or(()) |
| 227 | } |
| 228 | |
| 229 | /// Get a specific File in the Project by its id |
| 230 | /// |
nothing calls this directly
no test coverage detected