kodi
SavestateDatabase.h
1 /*
2  * Copyright (C) 2012-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include <memory>
12 #include <string>
13 
14 class CDateTime;
15 class CFileItem;
16 class CFileItemList;
17 
18 namespace KODI
19 {
20 namespace RETRO
21 {
22 class ISavestate;
23 
25 {
26 public:
28  virtual ~CSavestateDatabase() = default;
29 
30  static std::unique_ptr<ISavestate> AllocateSavestate();
31 
32  bool AddSavestate(const std::string& savestatePath,
33  const std::string& gamePath,
34  const ISavestate& save);
35 
36  bool GetSavestate(const std::string& savestatePath, ISavestate& save);
37 
38  bool GetSavestatesNav(CFileItemList& items,
39  const std::string& gamePath,
40  const std::string& gameClient = "");
41 
42  static void GetSavestateItem(const ISavestate& savestate,
43  const std::string& savestatePath,
44  CFileItem& item);
45 
46  std::unique_ptr<ISavestate> RenameSavestate(const std::string& savestatePath,
47  const std::string& label);
48 
49  bool DeleteSavestate(const std::string& savestatePath);
50 
51  bool ClearSavestatesOfGame(const std::string& gamePath, const std::string& gameClient = "");
52 
53  static std::string MakeSavestatePath(const std::string& gamePath, const CDateTime& creationTime);
54  static std::string MakeThumbnailPath(const std::string& savestatePath);
55 
56 private:
57  static std::string MakePath(const std::string& gamePath);
58  static bool CreateFolderIfNotExists(const std::string& path);
59 };
60 } // namespace RETRO
61 } // namespace KODI
Represents a list of files.
Definition: FileItem.h:702
Definition: ISavestate.h:28
bool ClearSavestatesOfGame(const std::string &gamePath, const std::string &gameClient="")
Definition: SavestateDatabase.cpp:228
Definition: AudioDecoder.h:18
Definition: SavestateDatabase.h:24
DateTime class, which uses FileTime as it&#39;s base.
Definition: XBDateTime.h:63
Represents a file on a share.
Definition: FileItem.h:102