Webserv
|
A strongly-typed data container for a server block's configuration. More...
#include <ServerConfig.hpp>
Public Member Functions | |
ServerConfig () | |
ServerConfig (char const *fpath, bool perform_fs_checks=true) | |
ServerConfig (std::string const &content, bool perform_fs_checks=true) | |
ServerBlock const * | getServer (int port, std::string const &server_name) const |
Retrieves the server configuration that best matches a port and server name. | |
void | addServer (ServerBlock const &) |
ServerBlockMap const & | getServersMap () const |
Private Member Functions | |
void | build (std::string const &content, bool perform_fs_checks) |
Private Attributes | |
ServerBlockMap | servers_ |
A strongly-typed data container for a server block's configuration.
This class holds the final, validated settings for a single 'server' block after all parsing and semantic validation is complete. It is the definitive configuration used by the webserver at runtime.
config::ServerConfig::ServerConfig | ( | ) |
config::ServerConfig::ServerConfig | ( | char const * | fpath, |
bool | perform_fs_checks = true ) |
config::ServerConfig::ServerConfig | ( | std::string const & | content, |
bool | perform_fs_checks = true ) |
void config::ServerConfig::addServer | ( | ServerBlock const & | server | ) |
|
private |
ServerBlock const * config::ServerConfig::getServer | ( | int | port, |
std::string const & | server_name ) const |
Retrieves the server configuration that best matches a port and server name.
port | The port number of the incoming connection. |
server_name | The server name requested by the client. |
ServerBlockMap const & config::ServerConfig::getServersMap | ( | ) | const |
|
private |