14std::filesystem::path
ResolvePath(std::string_view relativePath)
16 std::filesystem::path p(relativePath);
17 return p.is_absolute() ? p :
g_baseDir / p;
22 return std::format(
"addons/voltmod/plugins/{}", plugin);
25std::string
PluginFile(std::string_view plugin, std::string_view relative)
27 return std::format(
"{}/{}",
PluginDir(plugin), relative);
std::filesystem::path ResolvePath(std::string_view relativePath)
a relative path against the base directory. If the path is already absolute, returns it as-is.
void SetBaseDir(const std::filesystem::path &baseDir)
Set the base directory for path resolution (the host's csgo directory). Must be called during initial...
std::string PluginFile(std::string_view plugin, std::string_view relative)
"addons/voltmod/plugins/<plugin>/<relative>".
static std::filesystem::path g_baseDir
std::string PluginDir(std::string_view plugin)
"addons/voltmod/plugins/<plugin>". Pure string building, so safe at static init.