Caching of files is done : not tested yet.
This commit is contained in:
parent
3391f6f4c2
commit
b71a49cfbe
2 changed files with 69 additions and 1 deletions
|
@ -1,13 +1,38 @@
|
|||
#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 {
|
||||
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;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue