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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
996 B
C++
Raw Normal View History

#ifndef OPENMW_COMPONENTS_RESOURCE_FILESYSTEMARCHIVE_H
#define OPENMW_COMPONENTS_RESOURCE_FILESYSTEMARCHIVE_H
#include "archive.hpp"
#include <filesystem>
#include <string>
namespace VFS
{
class FileSystemArchiveFile : public File
{
public:
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:
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:
typedef std::map<std::string, FileSystemArchiveFile> index;
index mIndex;
bool mBuiltIndex;
std::filesystem::path mPath;
};
}
#endif