30 lines
701 B
C++
30 lines
701 B
C++
/*********************************/
|
|
/* */
|
|
/* o.riabenkyi@gmail.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 |