mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-29 13:27:59 +03:00
TOMLMap parser start
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define SERVERCONFIG_HPP
|
||||
|
||||
#include "webserv.hpp"
|
||||
#include "parse.hpp"
|
||||
|
||||
struct location
|
||||
{
|
||||
@@ -17,8 +18,10 @@ struct location
|
||||
|
||||
class ServerConfig
|
||||
{
|
||||
public:
|
||||
int ret;
|
||||
private:
|
||||
// TOMLMap *_root;
|
||||
TOMLMap *server;
|
||||
std::string _serverName;
|
||||
std::string _host;
|
||||
int _port;
|
||||
@@ -34,7 +37,7 @@ public:
|
||||
void setClientBodySize(int);
|
||||
void setErrorPages(std::map<int, std::string>);
|
||||
void setLocations(std::vector<location>);
|
||||
// void setRoot(TOMLMap *);
|
||||
void setRoot(TOMLMap *);
|
||||
|
||||
std::string getServerName(void);
|
||||
std::string getHost(void);
|
||||
@@ -42,12 +45,21 @@ public:
|
||||
int getClientBodySize(void);
|
||||
std::vector<location> getLocations(void);
|
||||
std::map<int, std::string> getErrorPages(void);
|
||||
// TOMLMap *getRoot(void);
|
||||
TOMLMap *getRoot(void);
|
||||
|
||||
public:
|
||||
ServerConfig();
|
||||
// ServerConfig(TOMLMap *root);
|
||||
|
||||
ServerConfig(TOMLMap *root);
|
||||
private:
|
||||
int identify(TOMLMap::iterator it);
|
||||
int putBodySizeLimit(toml_node *);
|
||||
int putErrorPage(toml_node *);
|
||||
int putHost(toml_node *);
|
||||
int putName(toml_node *);
|
||||
int putPort(toml_node *);
|
||||
int putLocation(toml_node *);
|
||||
|
||||
public:
|
||||
void fillFields(void);
|
||||
|
||||
~ServerConfig();
|
||||
|
||||
Reference in New Issue
Block a user