summaryrefslogtreecommitdiffhomepage
path: root/config.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-04-12 14:01:40 +0200
committerRoland Reichwein <mail@reichwein.it>2020-04-12 14:01:40 +0200
commit3f778eecc705990598f1033e6245522f42e2fcb5 (patch)
treedfa2af27ef4e6b6a299ecb014a684c272db77992 /config.h
parent77a68fbe16246245937c5d692bb8c89dc14d7800 (diff)
Refactor path concept
Diffstat (limited to 'config.h')
-rw-r--r--config.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/config.h b/config.h
index 61ad1ba..746b95c 100644
--- a/config.h
+++ b/config.h
@@ -11,7 +11,7 @@ namespace fs = std::filesystem;
struct Path
{
std::string requested; // the requested path
- // default entries: "plugin", "target"
+ // mandatory entries: "plugin", "target", others are optional
std::unordered_map<std::string, std::string> params; // what to serve, e.g. which filesystem path (target), and which plugin
};
@@ -68,17 +68,8 @@ class Config
// secondary calculation functions
//
- /// Root path in server's file system
- /// param[in] requested_host e.g. www.domain.com:8080 or www.domain.com
- std::string DocRoot(const Socket& socket, const std::string& requested_host, const std::string& requested_path) const;
-
- /// Get name of plugin
- std::string GetPlugin(const Socket& socket, const std::string& requested_host, const std::string& requested_path) const;
-
- /// requested_path = GetPluginPath() / GetRelativePath()
- std::string GetPluginPath(const Socket& socket, const std::string& requested_host, const std::string& requested_path) const;
- std::string GetRelativePath(const Socket& socket, const std::string& requested_host, const std::string& requested_path) const;
-
+ const Path& GetPath(const Socket& socket, const std::string& requested_host, const std::string& requested_path) const;
+
// return true iff plugin "name" is mentioned in config
bool PluginIsConfigured(const std::string& name) const;