| 219 | IFile::~IFile() = default; |
| 220 | |
| 221 | bool FileSystem::addPath(const UString &newPath) |
| 222 | { |
| 223 | if (!PHYSFS_mount(newPath.c_str(), "/", 0)) |
| 224 | { |
| 225 | LogInfo("Failed to add resource dir \"%s\", error: %s", newPath, |
| 226 | PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); |
| 227 | return false; |
| 228 | } |
| 229 | else |
| 230 | { |
| 231 | LogInfo("Resource dir \"%s\" mounted to \"%s\"", newPath, |
| 232 | PHYSFS_getMountPoint(newPath.c_str())); |
| 233 | return true; |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | FileSystem::FileSystem(std::vector<UString> paths) |
| 238 | { |