Play-/Source/saves/SaveImporterBase.h

33 lines
692 B
C
Raw Permalink Normal View History

2023-12-18 13:44:31 -05:00
#pragma once
2019-10-16 20:51:11 -04:00
#include "filesystem_def.h"
#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;
2023-12-18 13:44:31 -05:00
CSaveImporterBase() = default;
virtual ~CSaveImporterBase() = default;
2019-10-16 20:51:11 -04:00
virtual void Import(Framework::CStream&, const fs::path&) = 0;
2018-04-30 21:01:23 +01:00
void SetOverwritePromptHandler(const OverwritePromptHandlerType&);
protected:
2019-10-16 20:51:11 -04:00
bool CanExtractFile(const fs::path&);
private:
2023-12-18 13:44:31 -05:00
bool m_overwriteAll = false;
2018-04-30 21:01:23 +01:00
OverwritePromptHandlerType m_overwritePromptHandler;
};