Mercurial > minori
view include/core/anime_db.h @ 174:f88eda79c60a
anime/db: add some more json functionality, still doesn't compile :/
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 29 Nov 2023 13:53:56 -0500 |
parents | de0a8d2f28b3 |
children | 9b10175be389 |
line wrap: on
line source
#ifndef __core__anime_db_h #define __core__anime_db_h #include "core/anime.h" #include "core/json.h" #include <string> #include <unordered_map> namespace Anime { class Database { public: std::unordered_map<int, Anime> items; int GetTotalAnimeAmount(); int GetTotalEpisodeAmount(); int GetTotalWatchedAmount(); int GetTotalPlannedAmount(); double GetAverageScore(); double GetScoreDeviation(); int GetListsAnimeAmount(ListStatus status); int GetAnimeFromTitle(const std::string& title); bool GetDatabaseAsJSON(nlohmann::json& json); bool SaveDatabaseToDisk(); bool ParseDatabaseJSON(const nlohmann::json& json); bool LoadDatabaseFromFile(); protected: bool ParseAnimeInfoJSON(const nlohmann::json& json); }; extern Database db; } // namespace Anime #endif // __core__anime_db_h