Files
codam-webserver-team/include/config/Config.hpp
T

30 lines
701 B
C++

/*********************************/
/* */
/* o.riabenkyi@gmain.com */
/* */
/*********************************/
#ifndef CONFIG_HPP
#define CONFIG_HPP
#include <vector>
#include "ServerConfig.hpp"
// Holds every server block parsed from the configuration file and validates
// them, both individually and against each other.
class Config {
public:
Config();
void addServer(const ServerConfig &server);
const std::vector<ServerConfig> &getServers() const;
// Throws std::runtime_error with a descriptive message when invalid.
void validate() const;
private:
std::vector<ServerConfig> _servers;
};
#endif