remove: unused getName()
This commit is contained in:
parent
4cd3e394c3
commit
c09e5b6579
@ -19,7 +19,7 @@ class AConfig
|
|||||||
AConfig &operator=(AConfig &&other) noexcept = delete;
|
AConfig &operator=(AConfig &&other) noexcept = delete;
|
||||||
|
|
||||||
virtual ~AConfig() = default;
|
virtual ~AConfig() = default;
|
||||||
[[nodiscard]] virtual std::string getName() const = 0;
|
// [[nodiscard]] virtual std::string getName() const = 0;
|
||||||
[[nodiscard]] virtual std::string getType() const = 0;
|
[[nodiscard]] virtual std::string getType() const = 0;
|
||||||
void addDirective(const std::string &line);
|
void addDirective(const std::string &line);
|
||||||
[[nodiscard]] std::string getErrorPage(int statusCode) const;
|
[[nodiscard]] std::string getErrorPage(int statusCode) const;
|
||||||
|
|||||||
@ -13,10 +13,10 @@ GlobalConfig::GlobalConfig(const std::string &block)
|
|||||||
parseBlock(block);
|
parseBlock(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GlobalConfig::getName() const
|
// std::string GlobalConfig::getName() const
|
||||||
{
|
// {
|
||||||
return "global";
|
// return "global";
|
||||||
}
|
// }
|
||||||
|
|
||||||
std::string GlobalConfig::getType() const
|
std::string GlobalConfig::getType() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,7 +20,7 @@ class GlobalConfig : public AConfig
|
|||||||
|
|
||||||
~GlobalConfig() override = default;
|
~GlobalConfig() override = default;
|
||||||
|
|
||||||
[[nodiscard]] std::string getName() const override;
|
// [[nodiscard]] std::string getName() const override;
|
||||||
[[nodiscard]] std::string getType() const override;
|
[[nodiscard]] std::string getType() const override;
|
||||||
|
|
||||||
[[nodiscard]] std::vector<ServerConfig *> getServerConfigs() const;
|
[[nodiscard]] std::vector<ServerConfig *> getServerConfigs() const;
|
||||||
|
|||||||
@ -8,11 +8,11 @@ LocationConfig::LocationConfig(const std::string &block, const std::string &path
|
|||||||
parseBlock(block);
|
parseBlock(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string LocationConfig::getName() const
|
// std::string LocationConfig::getName() const
|
||||||
{
|
// {
|
||||||
auto parentName = parent_ != nullptr ? parent_->getName() : "root";
|
// auto parentName = parent_ != nullptr ? parent_->getName() : "root";
|
||||||
return parentName + ", location: " + _path;
|
// return parentName + ", location: " + _path;
|
||||||
}
|
// }
|
||||||
|
|
||||||
std::string LocationConfig::getType() const
|
std::string LocationConfig::getType() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class LocationConfig : public AConfig
|
|||||||
|
|
||||||
~LocationConfig() override = default;
|
~LocationConfig() override = default;
|
||||||
|
|
||||||
[[nodiscard]] std::string getName() const override;
|
// [[nodiscard]] std::string getName() const override;
|
||||||
[[nodiscard]] std::string getType() const override;
|
[[nodiscard]] std::string getType() const override;
|
||||||
|
|
||||||
[[nodiscard]] const std::string &getPath() const noexcept { return _path; }
|
[[nodiscard]] const std::string &getPath() const noexcept { return _path; }
|
||||||
|
|||||||
@ -16,11 +16,11 @@ ServerConfig::ServerConfig(const std::string &block, const AConfig *parent) : AC
|
|||||||
parseBlock(block);
|
parseBlock(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ServerConfig::getName() const
|
// std::string ServerConfig::getName() const
|
||||||
{
|
// {
|
||||||
return "server: " + get<std::string>("server_name").value_or("unnamed") + " (port "
|
// return "server: " + get<std::string>("server_name").value_or("unnamed") + " (port "
|
||||||
+ std::to_string(get<int>("listen").value_or(-1)) + ")";
|
// + std::to_string(get<int>("listen").value_or(-1)) + ")";
|
||||||
}
|
// }
|
||||||
|
|
||||||
std::string ServerConfig::getType() const
|
std::string ServerConfig::getType() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class ServerConfig : public AConfig
|
|||||||
|
|
||||||
~ServerConfig() override = default;
|
~ServerConfig() override = default;
|
||||||
|
|
||||||
[[nodiscard]] std::string getName() const override;
|
// [[nodiscard]] std::string getName() const override;
|
||||||
[[nodiscard]] std::string getType() const override;
|
[[nodiscard]] std::string getType() const override;
|
||||||
|
|
||||||
[[nodiscard]] const LocationConfig *getLocation(const std::string &path) const;
|
[[nodiscard]] const LocationConfig *getLocation(const std::string &path) const;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user