openmw/components/vfs/filesystemarchive.hpp

45 lines
964 B
C++
Raw Permalink Normal View History

#ifndef OPENMW_COMPONENTS_RESOURCE_FILESYSTEMARCHIVE_H
#define OPENMW_COMPONENTS_RESOURCE_FILESYSTEMARCHIVE_H
#include "archive.hpp"
#include "file.hpp"
#include <filesystem>
#include <string>
namespace VFS
{
class FileSystemArchiveFile : public File
{
public:
2022-09-22 21:26:05 +03:00
FileSystemArchiveFile(const std::filesystem::path& path);
Files::IStreamPtr open() override;
std::filesystem::path getPath() override { return mPath; }
2022-05-13 18:58:00 -07:00
private:
std::filesystem::path mPath;
};
class FileSystemArchive : public Archive
{
public:
2022-09-22 21:26:05 +03:00
FileSystemArchive(const std::filesystem::path& path);
2023-12-17 15:20:48 +01:00
void listResources(FileMap& out) override;
bool contains(Path::NormalizedView file) const override;
2020-12-29 21:45:59 +01:00
std::string getDescription() const override;
private:
std::map<VFS::Path::Normalized, FileSystemArchiveFile, std::less<>> mIndex;
std::filesystem::path mPath;
};
}
#endif