Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
EditDiamarCache.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_CACHE_EDITDIAMARCACHE_HPP_
2#define IV_SRC_CACHE_EDITDIAMARCACHE_HPP_
3
4#include "structs.hpp"
5
6namespace iv::cache::editor
7{
8
14{
15public:
17 ~EditDiamarCache() = default;
18
23 [[nodiscard]] std::shared_ptr<std::map<std::string, SpecificProjectCache>> cacheFromSpecificProjects() const;
24
29 [[nodiscard]] std::shared_ptr<GeneralCache> generalCache() const;
30
34 void save();
35
39 void load();
40
42 {
43 static constexpr std::string_view cacheFileName {"/cache.json"};
44 static constexpr uint8_t indentationSize {4};
45 static constexpr uint8_t numOfDirectoriesToKeep {5};
46 };
47
48private:
49
50 std::shared_ptr<std::map<std::string, SpecificProjectCache>>
52 std::shared_ptr<GeneralCache> m_generalCache;
53 JSON m_json; //Unused
54};
55
56}// namespace iv::cache::editor
57
58#endif//IV_SRC_CACHE_EDITDIAMARCACHE_HPP_
nlohmann::json JSON
Definition structs.hpp:7
Class to manage the cache of the EditDiamar application.
Definition EditDiamarCache.hpp:14
EditDiamarCache()
Definition EditDiamarCache.cpp:9
std::shared_ptr< std::map< std::string, SpecificProjectCache > > m_cacheFromSpecificProjects
Definition EditDiamarCache.hpp:51
std::shared_ptr< std::map< std::string, SpecificProjectCache > > cacheFromSpecificProjects() const
Get the cache from specific projects.
Definition EditDiamarCache.cpp:99
JSON m_json
Definition EditDiamarCache.hpp:53
std::shared_ptr< GeneralCache > generalCache() const
Get the general cache.
Definition EditDiamarCache.cpp:104
std::shared_ptr< GeneralCache > m_generalCache
Definition EditDiamarCache.hpp:52
void save()
Save cache to file.
Definition EditDiamarCache.cpp:15
void load()
Load cache from file.
Definition EditDiamarCache.cpp:56
Definition EditDiamarCache.cpp:7
static constexpr uint8_t numOfDirectoriesToKeep
Definition EditDiamarCache.hpp:45
static constexpr uint8_t indentationSize
Definition EditDiamarCache.hpp:44
static constexpr std::string_view cacheFileName
Definition EditDiamarCache.hpp:43