1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 07:53:52 +00:00
openmw/components/vfs/filesystemarchive.hpp

47 lines
996 B
C++
Raw Normal View History

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