summaryrefslogtreecommitdiffhomepage
path: root/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'config.h')
-rw-r--r--config.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/config.h b/config.h
index b1f17a3..e69b298 100644
--- a/config.h
+++ b/config.h
@@ -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;
};