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