-
Notifications
You must be signed in to change notification settings - Fork 0
/
Settings.hpp
40 lines (35 loc) · 1.39 KB
/
Settings.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Settings.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ychen2 <ychen2@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/02 22:05:06 by ychen2 #+# #+# */
/* Updated: 2024/06/20 01:10:01 by ychen2 ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <cstring>
#include <exception>
#include <fstream>
#include <iostream>
#include <map>
#include <netinet/in.h>
#include <sstream>
#include <string>
#include <sys/socket.h>
#include <vector>
#include "LocationConfig.hpp"
#include "ServerConfig.hpp"
class Settings {
public:
Settings(const ServerConfig &server);
std::string getListen() const;
void addServer(const ServerConfig &server);
friend class Server;
private:
int _socket_fd;
struct sockaddr_in _addr;
std::vector< ServerConfig > _servers;
};