2016-06-17 20:53:05 -04:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
|
|
class ArchiveReader
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
bool _initialized = false;
|
|
|
|
uint8_t* _buffer = nullptr;
|
|
|
|
virtual bool InternalLoadArchive(void* buffer, size_t size) = 0;
|
|
|
|
virtual vector<string> InternalGetFileList() = 0;
|
|
|
|
public:
|
|
|
|
~ArchiveReader();
|
|
|
|
|
|
|
|
bool LoadArchive(void* buffer, size_t size);
|
|
|
|
bool LoadArchive(string filename);
|
2017-04-22 13:19:21 -04:00
|
|
|
bool LoadArchive(std::istream &in);
|
|
|
|
|
2016-06-17 20:53:05 -04:00
|
|
|
std::stringstream GetStream(string filename);
|
|
|
|
|
2017-07-30 09:03:54 -04:00
|
|
|
vector<string> GetFileList(std::initializer_list<string> extensions = {});
|
2016-06-17 20:53:05 -04:00
|
|
|
|
2017-07-30 09:03:54 -04:00
|
|
|
virtual bool ExtractFile(string filename, vector<uint8_t> &output) = 0;
|
|
|
|
|
|
|
|
static shared_ptr<ArchiveReader> GetReader(string filepath);
|
2016-06-17 20:53:05 -04:00
|
|
|
};
|