diff options
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -1,6 +1,41 @@ #pragma once #include <string> +#include <unordered_map> +#include <vector> + +enum PathType +{ + Files, // serve files + Plugin // delegate to plugin +}; + +struct Path +{ + std::string requested; // the requested path + PathType type; + std::unordered_map<std::string, std::string> params; // what to serve, e.g. which filesystem path, or which plugin +}; + +struct Site +{ + std::string name; + std::string host; + std::vector<Path> paths; +}; + +enum SocketProtocol +{ + HTTP, + HTTPS +}; + +struct Socket +{ + std::string address; + std::string port; + SocketProtocol protocol; +}; class Config { @@ -10,6 +45,9 @@ class Config std::string m_user; std::string m_group; + std::vector<std::string> m_plugin_directories; + std::vector<Site> m_sites; + std::vector<Socket> m_sockets; public: Config(const std::string& filename); @@ -17,5 +55,7 @@ class Config // Data getters std::string User() const; std::string Group() const; + + void dump() const; }; |