Play-/Source/saves/MemoryCard.h

29 lines
479 B
C
Raw Permalink Normal View History

#pragma once
#include <memory>
2019-10-17 18:15:16 -04:00
#include <vector>
2019-10-16 20:51:11 -04:00
#include "filesystem_def.h"
#include "Save.h"
class CMemoryCard
{
public:
2018-04-30 21:01:23 +01:00
typedef std::shared_ptr<CSave> SavePtr;
typedef std::vector<SavePtr> SaveList;
2019-10-16 20:51:11 -04:00
CMemoryCard(const fs::path&);
2018-04-30 21:01:23 +01:00
virtual ~CMemoryCard() = default;
2018-04-30 21:01:23 +01:00
size_t GetSaveCount() const;
const CSave* GetSaveByIndex(size_t) const;
2019-10-16 20:51:11 -04:00
fs::path GetBasePath() const;
2018-04-30 21:01:23 +01:00
void RefreshContents();
private:
2018-04-30 21:01:23 +01:00
void ScanSaves();
2018-04-30 21:01:23 +01:00
SaveList m_saves;
2019-10-16 20:51:11 -04:00
fs::path m_basePath;
};