2012-10-09 01:25:44 +00:00
|
|
|
#ifndef _SAVEIMPORTERBASE_H_
|
|
|
|
#define _SAVEIMPORTERBASE_H_
|
|
|
|
|
2019-10-16 20:51:11 -04:00
|
|
|
#include "filesystem_def.h"
|
2012-10-09 01:25:44 +00:00
|
|
|
#include <functional>
|
|
|
|
#include "Stream.h"
|
|
|
|
|
|
|
|
class CSaveImporterBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum OVERWRITE_PROMPT_RETURN
|
|
|
|
{
|
|
|
|
OVERWRITE_YES,
|
|
|
|
OVERWRITE_YESTOALL,
|
|
|
|
OVERWRITE_NO
|
|
|
|
};
|
|
|
|
|
2019-10-16 20:51:11 -04:00
|
|
|
typedef std::function<OVERWRITE_PROMPT_RETURN(const fs::path&)> OverwritePromptHandlerType;
|
2012-10-09 01:25:44 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
CSaveImporterBase();
|
|
|
|
virtual ~CSaveImporterBase();
|
2012-10-09 01:25:44 +00:00
|
|
|
|
2019-10-16 20:51:11 -04:00
|
|
|
virtual void Import(Framework::CStream&, const fs::path&) = 0;
|
2012-10-09 01:25:44 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
void SetOverwritePromptHandler(const OverwritePromptHandlerType&);
|
2012-10-09 01:25:44 +00:00
|
|
|
|
|
|
|
protected:
|
2019-10-16 20:51:11 -04:00
|
|
|
bool CanExtractFile(const fs::path&);
|
2012-10-09 01:25:44 +00:00
|
|
|
|
|
|
|
private:
|
2018-04-30 21:01:23 +01:00
|
|
|
bool m_overwriteAll;
|
|
|
|
OverwritePromptHandlerType m_overwritePromptHandler;
|
2012-10-09 01:25:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|