remove: unused getName()

This commit is contained in:
Quinten 2025-10-29 16:53:47 +01:00
parent 4cd3e394c3
commit c09e5b6579
7 changed files with 18 additions and 18 deletions

View File

@ -19,7 +19,7 @@ class AConfig
AConfig &operator=(AConfig &&other) noexcept = delete;
virtual ~AConfig() = default;
[[nodiscard]] virtual std::string getName() const = 0;
// [[nodiscard]] virtual std::string getName() const = 0;
[[nodiscard]] virtual std::string getType() const = 0;
void addDirective(const std::string &line);
[[nodiscard]] std::string getErrorPage(int statusCode) const;

View File

@ -13,10 +13,10 @@ GlobalConfig::GlobalConfig(const std::string &block)
parseBlock(block);
}
std::string GlobalConfig::getName() const
{
return "global";
}
// std::string GlobalConfig::getName() const
// {
// return "global";
// }
std::string GlobalConfig::getType() const
{

View File

@ -20,7 +20,7 @@ class GlobalConfig : public AConfig
~GlobalConfig() override = default;
[[nodiscard]] std::string getName() const override;
// [[nodiscard]] std::string getName() const override;
[[nodiscard]] std::string getType() const override;
[[nodiscard]] std::vector<ServerConfig *> getServerConfigs() const;

View File

@ -8,11 +8,11 @@ LocationConfig::LocationConfig(const std::string &block, const std::string &path
parseBlock(block);
}
std::string LocationConfig::getName() const
{
auto parentName = parent_ != nullptr ? parent_->getName() : "root";
return parentName + ", location: " + _path;
}
// std::string LocationConfig::getName() const
// {
// auto parentName = parent_ != nullptr ? parent_->getName() : "root";
// return parentName + ", location: " + _path;
// }
std::string LocationConfig::getType() const
{

View File

@ -17,7 +17,7 @@ class LocationConfig : public AConfig
~LocationConfig() override = default;
[[nodiscard]] std::string getName() const override;
// [[nodiscard]] std::string getName() const override;
[[nodiscard]] std::string getType() const override;
[[nodiscard]] const std::string &getPath() const noexcept { return _path; }

View File

@ -16,11 +16,11 @@ ServerConfig::ServerConfig(const std::string &block, const AConfig *parent) : AC
parseBlock(block);
}
std::string ServerConfig::getName() const
{
return "server: " + get<std::string>("server_name").value_or("unnamed") + " (port "
+ std::to_string(get<int>("listen").value_or(-1)) + ")";
}
// std::string ServerConfig::getName() const
// {
// return "server: " + get<std::string>("server_name").value_or("unnamed") + " (port "
// + std::to_string(get<int>("listen").value_or(-1)) + ")";
// }
std::string ServerConfig::getType() const
{

View File

@ -21,7 +21,7 @@ class ServerConfig : public AConfig
~ServerConfig() override = default;
[[nodiscard]] std::string getName() const override;
// [[nodiscard]] std::string getName() const override;
[[nodiscard]] std::string getType() const override;
[[nodiscard]] const LocationConfig *getLocation(const std::string &path) const;