2015-03-17 21:59:39 +01:00
|
|
|
#ifndef OPENMW_COMPONENTS_RESOURCE_ARCHIVE_H
|
|
|
|
#define OPENMW_COMPONENTS_RESOURCE_ARCHIVE_H
|
|
|
|
|
2022-07-28 22:20:44 +02:00
|
|
|
#include <filesystem>
|
2015-03-17 21:59:39 +01:00
|
|
|
#include <map>
|
|
|
|
|
2022-07-16 18:19:56 +02:00
|
|
|
#include <components/files/istreamptr.hpp>
|
2015-03-17 21:59:39 +01:00
|
|
|
|
|
|
|
namespace VFS
|
|
|
|
{
|
|
|
|
|
|
|
|
class File
|
|
|
|
{
|
|
|
|
public:
|
2023-05-31 23:11:03 +02:00
|
|
|
virtual ~File() = default;
|
2015-03-17 21:59:39 +01:00
|
|
|
|
|
|
|
virtual Files::IStreamPtr open() = 0;
|
2022-05-13 18:58:00 -07:00
|
|
|
|
2022-06-19 13:28:33 +02:00
|
|
|
virtual std::filesystem::path getPath() = 0;
|
2015-03-17 21:59:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class Archive
|
|
|
|
{
|
|
|
|
public:
|
2023-05-31 23:11:03 +02:00
|
|
|
virtual ~Archive() = default;
|
2015-03-17 21:59:39 +01:00
|
|
|
|
2023-05-31 23:11:03 +02:00
|
|
|
/// List all resources contained in this archive.
|
|
|
|
virtual void listResources(std::map<std::string, File*>& out) = 0;
|
2020-12-29 21:45:59 +01:00
|
|
|
|
|
|
|
/// True if this archive contains the provided normalized file.
|
2023-05-31 23:11:03 +02:00
|
|
|
virtual bool contains(const std::string& file) const = 0;
|
2020-12-29 21:45:59 +01:00
|
|
|
|
|
|
|
virtual std::string getDescription() const = 0;
|
2015-03-17 21:59:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|