-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServer.hpp
More file actions
63 lines (57 loc) · 2.33 KB
/
Copy pathServer.hpp
File metadata and controls
63 lines (57 loc) · 2.33 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Server.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hlakhal- <hlakhal-@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/05 20:41:04 by hlakhal- #+# #+# */
/* Updated: 2024/02/16 08:55:28 by hlakhal- ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SERVER_HPP
#define SERVER_HPP
#include "Location.hpp"
#include"Server.hpp"
#include "Client.hpp"
#include <errno.h>
#include <stdio.h>
#include <cstdlib>
#include <cstring>
#include <limits>
class Location;
class Server
{
private:
__uint16_t listen;
u_long host;
std::string root;
std::map<int,std::string > eroorPage;
std::vector<Location> Locations;
std::map<int, Client> clinets;
double client_max_body_size;
std::vector<std::string> name;
public:
Server();
Server(const Server& other);
void addLocation(Location* location);
void setListen(std::string& listen);
void setHost(std::string& host);
void setMaxBodySize(std::string& maxBodySize);
void setRoot(std::string& root);
void setClient(std::map<int ,Client> & ClinetData);
void setPathError(std::string& path);
void setServerName(std::string& serverName);
Server& operator=(const Server& other);
__uint16_t getListen() const;
const std::vector<Location>& getLocation() const;
const std::string& getRoot() const;
u_long getHost() const;
const std::map<int , std::string>& getErrorPath() const;
Server* createServer();
double getMaxBodySize() const;
const std::vector<std::string>& getServerName() const;
std::string trim(std::string& word);
virtual ~Server() throw();
};
#endif