webserv/webserv/config/LocationConfig.cpp
2025-10-26 13:43:42 +01:00

25 lines
598 B
C++

#include <webserv/config/LocationConfig.hpp>
#include <webserv/config/AConfig.hpp> // for AConfig
LocationConfig::LocationConfig(const std::string &block, const std::string &path, const AConfig *parent)
: AConfig(parent), _path(path)
{
parseBlock(block);
}
std::string LocationConfig::getName() const
{
auto parentName = parent_ != nullptr ? parent_->getName() : "root";
return parentName + ", location: " + _path;
}
std::string LocationConfig::getType() const
{
return "location";
}
void LocationConfig::parseBlock(const std::string &block)
{
parseDirectives(block);
}