From e8a7c88b6cedbd05b183e85dff74c513bfcd774e Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Thu, 5 Jan 2023 19:47:05 +0100 Subject: Test config.cpp --- config.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'config.h') diff --git a/config.h b/config.h index a021c80..d0e78ba 100644 --- a/config.h +++ b/config.h @@ -6,8 +6,7 @@ #include #include -namespace fs = std::filesystem; - +// URL path, not FS struct Path { std::string requested; // the requested path @@ -21,8 +20,8 @@ struct Site // std::string name; is the index in the m_sites map std::unordered_set hosts; std::vector paths; - fs::path cert_path; - fs::path key_path; + std::filesystem::path cert_path; + std::filesystem::path key_path; }; enum class SocketProtocol @@ -43,9 +42,9 @@ struct Socket class Config { - const std::string default_filename{"/etc/webserver.conf"}; + const std::filesystem::path default_filename{"/etc/webserver.conf"}; - void readConfigfile(std::string filename); + void readConfigfile(const std::filesystem::path& filename); void expand_socket_sites(); void validate(); void create_look_up_table(); @@ -58,7 +57,7 @@ class Config std::vector m_sockets; public: - Config(const std::string& filename); + Config(const std::filesystem::path& filename); // Data getters std::string User() const; -- cgit v1.2.3