Configuration is partially made.
Compilation and linker flags for spdlog are changed to be usable with clang and the project. Another default logger is made in the main.cpp Correction in README.md and format.
This commit is contained in:
parent
d113932c8f
commit
23246d0d9d
6 changed files with 116 additions and 26 deletions
15
src/configuration.cpp
Normal file
15
src/configuration.cpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include "../include/configuration.hpp"
|
||||
#include "../include/information.hpp"
|
||||
#include "../include/cache_files.hpp"
|
||||
|
||||
std::pair<gemini::Information, std::optional<gemini::CacheFiles>> gemini::Configuration::create_infos() const {
|
||||
simdjson::dom::parser parser;
|
||||
const auto config = parser.load(filename);
|
||||
const Information infos{
|
||||
config["cache"]["enable_cache"].get_bool(),
|
||||
config["cache"]["cache_size"].get_uint64(),
|
||||
config["ssl"]["pem_path"].get_c_str().value(),
|
||||
config["ssl"]["cert_path"].get_c_str().value() };
|
||||
return std::make_pair(infos,
|
||||
infos.enable_cache ? std::optional(CacheFiles(config["content"]["path"].get_c_str().value(), infos)) : std::nullopt);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue