void FileSystem::mount(const std::string &mount_point, const std::string &path, bool is_zip_file) { if (is_zip_file) mount(mount_point, FileSystem(new FileSystemProvider_Zip(ZipArchive(path)))); else mount(mount_point, FileSystem(new FileSystemProvider_File(path))); }
FileSystem::FileSystem(const std::string &path, bool is_zip_file) : impl(std::make_shared<FileSystem_Impl>()) { if (is_zip_file) impl->provider = new FileSystemProvider_Zip(ZipArchive(path)); else impl->provider = new FileSystemProvider_File(path); }
RasterTerrain * RasterTerrain::OpenTerrain(FileCache *cache, OperationEnvironment &operation) try { const auto path = Profile::GetPath(ProfileKeys::MapFile); if (path.IsNull()) return nullptr; RasterTerrain *rt = new RasterTerrain(ZipArchive(path)); if (!rt->Load(path, cache, operation)) { delete rt; return nullptr; } return rt; } catch (const std::runtime_error &e) { operation.SetErrorMessage(UTF8ToWideConverter(e.what())); return nullptr; }