2023-12-18 13:44:31 -05:00
|
|
|
#pragma once
|
2012-10-09 01:25:44 +00:00
|
|
|
|
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
|
|
|
|
2023-12-18 13:44:31 -05:00
|
|
|
CSaveImporterBase() = default;
|
|
|
|
virtual ~CSaveImporterBase() = default;
|
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:
|
2023-12-18 13:44:31 -05:00
|
|
|
bool m_overwriteAll = false;
|
2018-04-30 21:01:23 +01:00
|
|
|
OverwritePromptHandlerType m_overwritePromptHandler;
|
2012-10-09 01:25:44 +00:00
|
|
|
};
|