Skip to content

Commit 1ccdcdb

Browse files
committed
Remove unused includes
1 parent d2fa0f6 commit 1ccdcdb

33 files changed

+99
-79
lines changed

include/config/Config.hpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
#ifndef CONFIG_HPP
22
#define CONFIG_HPP
33

4-
#include <set>
54
#include <string>
65
#include <vector>
76

87
#include "Context.hpp"
9-
#include "File.hpp"
10-
#include "Http.hpp"
11-
#include "global.hpp"
12-
#include "utils.hpp"
138

149
// ----------------------- CONFIG STRUCTURE ------------------------
1510
typedef struct token_s {
@@ -60,27 +55,33 @@ const token_t tokens_g[] = {
6055

6156
// Mime type context
6257
{"types", "http", true, 1, 1, 0, 0, NULL},
63-
{"type", "types", false, 1, static_cast<size_t>(-1), 2, static_cast<size_t>(-1), isMimeType},
58+
{"type", "types", false, 1, static_cast<size_t>(-1), 2,
59+
static_cast<size_t>(-1), isMimeType},
6460

6561
// Server context
6662
{"server", "http", true, 1, static_cast<size_t>(-1), 0, 0, NULL},
6763
{"listen", "server", false, 1, static_cast<size_t>(-1), 1, 1, isListen},
68-
{"server_name", "server", false, 0, static_cast<size_t>(-1), 1, static_cast<size_t>(-1), NULL},
64+
{"server_name", "server", false, 0, static_cast<size_t>(-1), 1,
65+
static_cast<size_t>(-1), NULL},
6966
{"root", "server", false, 1, 1, 1, 1, NULL},
7067
{"index", "server", false, 0, 1, 1, static_cast<size_t>(-1), NULL},
71-
{"allow", "server", false, 0, static_cast<size_t>(-1), 1, static_cast<size_t>(-1), isMethod},
68+
{"allow", "server", false, 0, static_cast<size_t>(-1), 1,
69+
static_cast<size_t>(-1), isMethod},
7270
{"autoindex", "server", false, 0, 1, 1, 1, isBoolean},
7371
{"redirect", "server", false, 0, 1, 1, 1, NULL},
7472
{"max_client_body_size", "server", false, 0, 1, 1, 1, isMemorySize},
75-
{"error_page", "server", false, 0, static_cast<size_t>(-1), 2, 2, isErrorPage},
73+
{"error_page", "server", false, 0, static_cast<size_t>(-1), 2, 2,
74+
isErrorPage},
7675
{"cgi", "server", false, 0, static_cast<size_t>(-1), 2, 2, isCgi},
7776

7877
// Location context
79-
{"location", "server", true, 0, static_cast<size_t>(-1), 1, 1, isAbsolutePath},
78+
{"location", "server", true, 0, static_cast<size_t>(-1), 1, 1,
79+
isAbsolutePath},
8080
{"alias", "location", false, 0, 1, 1, 1, isAbsolutePath},
8181
{"root", "location", false, 0, 1, 1, 1, NULL},
8282
{"index", "location", false, 0, 1, 1, static_cast<size_t>(-1), NULL},
83-
{"allow", "location", false, 0, static_cast<size_t>(-1), 1, static_cast<size_t>(-1), isMethod},
83+
{"allow", "location", false, 0, static_cast<size_t>(-1), 1,
84+
static_cast<size_t>(-1), isMethod},
8485
{"autoindex", "location", false, 0, 1, 1, 1, isBoolean},
8586
{"redirect", "location", false, 0, 1, 1, 1, NULL},
8687
{"max_client_body_size", "location", false, 0, 1, 1, 1, isMemorySize},
@@ -105,7 +106,7 @@ class Config {
105106
// Removes all comments from the config file
106107
// @exception No custom exceptions
107108
void removeComments();
108-
109+
109110
// Recursively parses a context
110111
// @param context The context to add data to
111112
// @param data The data to parse

include/config/Context.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
#ifndef CONTEXT_HPP
22
#define CONTEXT_HPP
33

4-
#include <iostream>
54
#include <map>
65
#include <string>
76
#include <vector>
87

9-
#include "colors.hpp"
10-
#include "utils.hpp"
11-
128
class Context {
139
private:
1410
std::string _name;

include/config/Init.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#ifndef INIT_HPP
22
#define INIT_HPP
33

4-
#include "ListenSocket.hpp"
5-
#include "Log.hpp"
6-
#include "Poll.hpp"
7-
#include "VirtualHost.hpp"
4+
#include "Context.hpp"
85

96
class Init {
107
private:

include/config/argument.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#ifndef ARGUMENT_HPP
22
#define ARGUMENT_HPP
33

4-
#include "Config.hpp"
5-
#include "global.hpp"
6-
#include "output.hpp"
4+
#include <list>
5+
#include <string>
76

87
// ------------------------- ARG STRUCTURE -------------------------
98
typedef enum arg_state_e {

include/http/Http.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,19 @@
22
#define HTTP_HPP
33

44
#include <fstream>
5-
#include <sstream>
65

76
#include "AConnection.hpp"
87
#include "File.hpp"
98
#include "Request.hpp"
109
#include "Response.hpp"
1110
#include "VirtualHost.hpp"
12-
#include "global.hpp"
13-
#include "webserv.hpp"
1411

1512
// WEBSERV_CONFIG ----------- HTTP VALUES --------------------------
1613
#define PROTOCOL "HTTP"
1714
#define HTTP_VERSION "1.1"
18-
#define HTTP_METHODS \
19-
{ "GET", "HEAD", "OPTIONS", "POST", "PUT", "DELETE" }
15+
#define HTTP_METHODS {"GET", "HEAD", "OPTIONS", "POST", "PUT", "DELETE"}
2016
#define HTTP_DEFAULT_METHOD_COUNT 3
21-
#define HTTP_DEFAULT_METHODS \
22-
{ "GET", "HEAD", "OPTIONS" }
17+
#define HTTP_DEFAULT_METHODS {"GET", "HEAD", "OPTIONS"}
2318
#define HTTP_DEFAULT_MIME "application/octet-stream"
2419
#define MAX_CLIENT_BODY_SIZE 1048576
2520

include/http/Request.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#ifndef REQUEST_HPP
22
#define REQUEST_HPP
33

4-
#include <algorithm>
4+
#include <list>
55
#include <map>
66
#include <string>
7-
#include <vector>
87

98
#include "Uri.hpp"
10-
#include "utils.hpp"
119

1210
class Request {
1311
private:

include/http/Response.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef RESPONSE_HPP
22
#define RESPONSE_HPP
33

4-
#include <algorithm>
54
#include <istream>
65
#include <list>
76
#include <map>

include/http/Uri.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
#include <string>
55

6-
#include "utils.hpp"
7-
86
class Uri {
97
private:
108
std::string _scheme;

include/output/Log.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33

44
#include <fstream>
55
#include <iostream>
6-
#include <map>
76
#include <ostream>
87
#include <string>
98

10-
#include "File.hpp"
119
#include "colors.hpp"
12-
#include "utils.hpp"
1310

1411
typedef enum log_level_e { ERROR, WARNING, INFO, DEBUG, VERBOSE } log_level_t;
1512

include/poll/AConnection.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#include "Address.hpp"
1212
#include "CallbackPointer.hpp"
13-
#include "timeval.hpp"
1413

1514
// WEBSERV_CONFIG ----------- ACONNECTION VALUES -------------------
1615
/**

0 commit comments

Comments
 (0)