1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +00:00
OpenMW/components/vfs/filesystemarchive.hpp

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

46 lines
976 B
C++
Raw 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:
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:
FileSystemArchive(const std::filesystem::path& path);
2023-12-17 15:20:48 +01:00
void listResources(FileMap& out) override;
2023-12-17 15:20:48 +01:00
bool contains(std::string_view file) const override;
2020-12-29 21:45:59 +01:00
std::string getDescription() const override;
private:
2023-12-17 15:20:48 +01:00
std::map<std::string, FileSystemArchiveFile, std::less<>> mIndex;
bool mBuiltIndex;
std::filesystem::path mPath;
};
}
#endif