Play-/Source/saves/SaveImporterBase.h
Jean-Philip Desjardins 55178b6797 Cleanup.
2023-12-18 13:44:31 -05:00

32 lines
692 B
C++

#pragma once
#include "filesystem_def.h"
#include <functional>
#include "Stream.h"
class CSaveImporterBase
{
public:
enum OVERWRITE_PROMPT_RETURN
{
OVERWRITE_YES,
OVERWRITE_YESTOALL,
OVERWRITE_NO
};
typedef std::function<OVERWRITE_PROMPT_RETURN(const fs::path&)> OverwritePromptHandlerType;
CSaveImporterBase() = default;
virtual ~CSaveImporterBase() = default;
virtual void Import(Framework::CStream&, const fs::path&) = 0;
void SetOverwritePromptHandler(const OverwritePromptHandlerType&);
protected:
bool CanExtractFile(const fs::path&);
private:
bool m_overwriteAll = false;
OverwritePromptHandlerType m_overwritePromptHandler;
};