コード例 #1
0
ファイル: file_system.cpp プロジェクト: finalJ2/ClanLib
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)));
}
コード例 #2
0
ファイル: file_system.cpp プロジェクト: finalJ2/ClanLib
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);
}
コード例 #3
0
ファイル: RasterTerrain.cpp プロジェクト: Advi42/XCSoar
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;
}