mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-28 21:07:59 +03:00
59 lines
1.1 KiB
C++
59 lines
1.1 KiB
C++
#ifndef SERVERCONFIG_HPP
|
|
#define SERVERCONFIG_HPP
|
|
|
|
#include "webserv.hpp"
|
|
|
|
struct location
|
|
{
|
|
std::string location;
|
|
std::string root;
|
|
std::string directoryFile;
|
|
std::string uploadDir;
|
|
bool autoindex;
|
|
bool uploadAccept;
|
|
std::vector<std::string> methods;
|
|
std::map<int, std::string> redirect;
|
|
};
|
|
|
|
class ServerConfig
|
|
{
|
|
private:
|
|
// TOMLMap *_root;
|
|
std::string _serverName;
|
|
std::string _host;
|
|
int _port;
|
|
int _clientBodySize;
|
|
|
|
std::map<int, std::string> _errorPages;
|
|
std::vector<location> _locations;
|
|
|
|
public:
|
|
void setServerName(std::string);
|
|
void setHost(std::string);
|
|
void setPort(int);
|
|
void setClientBodySize(int);
|
|
void setErrorPages(std::map<int, std::string>);
|
|
void setLocations(std::vector<location>);
|
|
// void setRoot(TOMLMap *);
|
|
|
|
std::string getServerName(void);
|
|
std::string getHost(void);
|
|
int getPort(void);
|
|
int getClientBodySize(void);
|
|
std::vector<location> getLocations(void);
|
|
std::map<int, std::string> getErrorPages(void);
|
|
// TOMLMap *getRoot(void);
|
|
|
|
public:
|
|
ServerConfig();
|
|
// ServerConfig(TOMLMap *root);
|
|
|
|
void fillFields(void);
|
|
|
|
~ServerConfig();
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif |