first approximation of the parser

This commit is contained in:
2026-09-08 11:06:04 +02:00
parent b15ce130f9
commit bdb434d9d5
13 changed files with 910 additions and 5 deletions
+30
View File
@@ -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