summaryrefslogtreecommitdiffhomepage
path: root/config.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-05 19:47:05 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-05 19:47:05 +0100
commite8a7c88b6cedbd05b183e85dff74c513bfcd774e (patch)
tree5d0fe8c8b387ca4846b0ec76a4955aa92c363f21 /config.h
parentd2690b7c3639cc1555b34d002de782976cbb6845 (diff)
Test config.cpp
Diffstat (limited to 'config.h')
-rw-r--r--config.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/config.h b/config.h
index a021c80..d0e78ba 100644
--- a/config.h
+++ b/config.h
@@ -6,8 +6,7 @@
#include <unordered_set>
#include <vector>
-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<std::string> hosts;
std::vector<Path> 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<Socket> m_sockets;
public:
- Config(const std::string& filename);
+ Config(const std::filesystem::path& filename);
// Data getters
std::string User() const;