diff options
Diffstat (limited to 'database.h')
| -rw-r--r-- | database.h | 62 |
1 files changed, 0 insertions, 62 deletions
| diff --git a/database.h b/database.h deleted file mode 100644 index 50f5b55..0000000 --- a/database.h +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | #ifndef DATABASE_H_75C3CE0F | ||
| 2 | #define DATABASE_H_75C3CE0F | ||
| 3 | |||
| 4 | #include <string> | ||
| 5 | |||
| 6 | struct sqlite3; | ||
| 7 | |||
| 8 | struct achievement { | ||
| 9 | int achievementId; | ||
| 10 | int gameId; | ||
| 11 | std::string title; | ||
| 12 | std::string color; | ||
| 13 | }; | ||
| 14 | |||
| 15 | struct did { | ||
| 16 | int profileId; | ||
| 17 | std::string date; | ||
| 18 | }; | ||
| 19 | |||
| 20 | class database { | ||
| 21 | public: | ||
| 22 | |||
| 23 | // Constructor | ||
| 24 | |||
| 25 | explicit database(std::string path); | ||
| 26 | |||
| 27 | // Disable copying | ||
| 28 | |||
| 29 | database(const database& other) = delete; | ||
| 30 | database& operator=(const database& other) = delete; | ||
| 31 | |||
| 32 | // Move constructor and move assignment | ||
| 33 | |||
| 34 | database(database&& other); | ||
| 35 | database& operator=(database&& other); | ||
| 36 | |||
| 37 | // Swap | ||
| 38 | |||
| 39 | friend void swap(database& first, database& second); | ||
| 40 | |||
| 41 | // Destructor | ||
| 42 | |||
| 43 | ~database(); | ||
| 44 | |||
| 45 | // Accessors | ||
| 46 | |||
| 47 | achievement getRandomAchievement() const; | ||
| 48 | |||
| 49 | bool doesGameHaveImages(int gameId) const; | ||
| 50 | |||
| 51 | std::string getRandomImageForGame(int gameId) const; | ||
| 52 | |||
| 53 | did getRandomDidForAchievement(int achievementId) const; | ||
| 54 | |||
| 55 | private: | ||
| 56 | |||
| 57 | database() = default; | ||
| 58 | |||
| 59 | sqlite3* ppdb_ = nullptr; | ||
| 60 | }; | ||
| 61 | |||
| 62 | #endif /* end of include guard: DATABASE_H_75C3CE0F */ | ||
