mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-29 13:27:59 +03:00
replacement: reference getters
This commit is contained in:
@@ -13,32 +13,32 @@ ServerConfig::ServerConfig(TOMLMap *map)
|
||||
}
|
||||
|
||||
//--------------------------------------------------GET/SET---------------------------------------
|
||||
std::string ServerConfig::getServerName(void)
|
||||
std::string &ServerConfig::getServerName(void)
|
||||
{
|
||||
return (_serverName);
|
||||
}
|
||||
|
||||
std::string ServerConfig::getHost(void)
|
||||
std::string &ServerConfig::getHost(void)
|
||||
{
|
||||
return (_host);
|
||||
}
|
||||
|
||||
int ServerConfig::getPort(void)
|
||||
int &ServerConfig::getPort(void)
|
||||
{
|
||||
return (_port);
|
||||
}
|
||||
|
||||
int ServerConfig::getClientBodySize(void)
|
||||
int &ServerConfig::getClientBodySize(void)
|
||||
{
|
||||
return (_clientBodySize);
|
||||
}
|
||||
|
||||
std::vector<location *> ServerConfig::getLocations(void)
|
||||
std::vector<location *> &ServerConfig::getLocations(void)
|
||||
{
|
||||
return (_locations);
|
||||
}
|
||||
|
||||
std::map<int, std::string> ServerConfig::getErrorPages(void)
|
||||
std::map<int, std::string> &ServerConfig::getErrorPages(void)
|
||||
{
|
||||
return (_errorPages);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,12 @@ struct location
|
||||
std::map<int, std::string> redirect;
|
||||
};
|
||||
|
||||
struct serverListen
|
||||
{
|
||||
std::string ip;
|
||||
int port;
|
||||
};
|
||||
|
||||
class ServerConfig
|
||||
{
|
||||
public:
|
||||
@@ -39,12 +45,12 @@ public:
|
||||
void setLocations(std::vector<location *>);
|
||||
void setRoot(TOMLMap *);
|
||||
|
||||
std::string getServerName(void);
|
||||
std::string getHost(void);
|
||||
int getPort(void);
|
||||
int getClientBodySize(void);
|
||||
std::vector<location *> getLocations(void);
|
||||
std::map<int, std::string> getErrorPages(void);
|
||||
std::string &getServerName(void);
|
||||
std::string &getHost(void);
|
||||
int &getPort(void);
|
||||
int &getClientBodySize(void);
|
||||
std::vector<location *> &getLocations(void);
|
||||
std::map<int, std::string> &getErrorPages(void);
|
||||
TOMLMap *getRoot(void);
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user