first approximation of the parser
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/*********************************/
|
||||
/* */
|
||||
/* 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
|
||||
Reference in New Issue
Block a user