gemini-server/include/cache_files.hpp

41 lines
905 B
C++

#ifndef GEMINISERVER_CACHE_FILES_HPP
#define GEMINISERVER_CACHE_FILES_HPP
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <filesystem>
namespace gemini {
struct Information;
/**
* \brief This class is used to store the files in cache.
*/
class CacheFiles final {
private:
std::unordered_set<std::string> files;
std::unordered_map<std::string, std::string> content;
public:
const Information &information;
CacheFiles() = delete;
CacheFiles(const std::filesystem::path &folder, const Information &infos);
~CacheFiles() noexcept = default;
[[nodiscard, gnu::always_inline]] inline const std::unordered_set<std::string> &get_files() const {
return files;
}
[[nodiscard, gnu::always_inline]] inline const std::unordered_map<std::string, std::string> &get_content() const {
return content;
}
};
}
#endif //GEMINISERVER_CACHE_FILES_HPP