Skip to content

Commit

Permalink
chore(*.hpp): Moved error info to webserv.hpp and removed repeated in…
Browse files Browse the repository at this point in the history
…cludes
  • Loading branch information
Taanviir committed Jan 23, 2024
1 parent 9496337 commit efe13ab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
11 changes: 0 additions & 11 deletions includes/error.hpp → includes/debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,4 @@
# define DEBUGASSERT(x) do {} while (0)
# endif // __DEBUG__

/* ----------------------------- ERROR MESSAGES ----------------------------- */
# include <string>
static std::string ERR_NULL("Socket: null ptr error");
static std::string ERR_CREAT("Socket: creation failed");
static std::string ERR_BIND("Socket: binding failed");
static std::string ERR_NBIND("Socket: not bound to a port");
static std::string ERR_LIST("Socket: listen failed");
static std::string ERR_NLIST("Socket: not listeing");
static std::string ERR_ACCP("Socket: accept failed");


#endif // ERROR_HPP
11 changes: 11 additions & 0 deletions includes/webserv.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
#ifndef WEBSERV_HPP
#define WEBSERV_HPP

/* -------------------------------- INCLUDES -------------------------------- */
#include <iostream>
#include <string>
#include "debug.hpp"

/* ----------------------------- ERROR MESSAGES ----------------------------- */
static std::string ERR_NULL("Socket: null ptr error");
static std::string ERR_CREAT("Socket: creation failed");
static std::string ERR_BIND("Socket: binding failed");
static std::string ERR_NBIND("Socket: not bound to a port");
static std::string ERR_LIST("Socket: listen failed");
static std::string ERR_NLIST("Socket: not listeing");
static std::string ERR_ACCP("Socket: accept failed");

#endif // WEBSERV_HPP
1 change: 0 additions & 1 deletion parser/ConfigParser.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef CONFIG_PARSER_HPP
#define CONFIG_PARSER_HPP

#include "../includes/error.hpp"
#include "../includes/webserv.hpp"
#include <fstream>

Expand Down
3 changes: 1 addition & 2 deletions server/socket/Socket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
#include <netinet/in.h>
#include <netinet/ip.h> /* superset of previous */
#include <sstream>
#include <string>
#include <sys/socket.h>
#include <unistd.h>
#include "../../includes/error.hpp"
#include "../../includes/webserv.hpp"

// TODO // [P]artially implemented, needs [I]mprovement, [X] done
//
Expand Down

0 comments on commit efe13ab

Please sign in to comment.