clang-format
This commit is contained in:
parent
901f766599
commit
ba831957d4
@ -1,13 +1,15 @@
|
||||
#include <webserv/client/Client.hpp>
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
#include <stdint.h> // for uint8_t
|
||||
#include <sys/types.h> // for ssize_t
|
||||
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
||||
#include <webserv/server/Server.hpp> // for Server
|
||||
#include <webserv/socket/Socket.hpp> // for Socket
|
||||
#include <functional> // for reference_wrapper, cref, ref
|
||||
#include <map> // for map
|
||||
#include <utility> // for pair, move
|
||||
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
#include <webserv/server/Server.hpp> // for Server
|
||||
#include <webserv/socket/Socket.hpp> // for Socket
|
||||
|
||||
#include <functional> // for reference_wrapper, cref, ref
|
||||
#include <map> // for map
|
||||
#include <utility> // for pair, move
|
||||
|
||||
#include <stdint.h> // for uint8_t
|
||||
#include <sys/types.h> // for ssize_t
|
||||
|
||||
Client::Client(std::unique_ptr<Socket> socket, Server &server, const ServerConfig &server_config)
|
||||
: client_socket_(std::move(socket)), server_(std::ref(server)), server_config_(std::cref(server_config)),
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
#include <webserv/config/ConfigManager.hpp>
|
||||
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
||||
#include <webserv/config/utils.hpp> // for trim, findCorrespondingClosingBrace, trimSemi
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
#include <stddef.h> // for size_t
|
||||
#include <fstream> // for basic_ifstream, basic_istream, basic_filebuf, basic_ostream::operator<<, ifstream, istringstream, stringstream
|
||||
#include <sstream> // for basic_stringstream, basic_istringstream
|
||||
#include <stdexcept> // for runtime_error
|
||||
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
||||
#include <webserv/config/utils.hpp> // for trim, findCorrespondingClosingBrace, trimSemi
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
|
||||
#include <fstream> // for basic_ifstream, basic_istream, basic_filebuf, basic_ostream::operator<<, ifstream, istringstream, stringstream
|
||||
#include <sstream> // for basic_stringstream, basic_istringstream
|
||||
#include <stdexcept> // for runtime_error
|
||||
|
||||
#include <stddef.h> // for size_t
|
||||
|
||||
ConfigManager::ConfigManager() : initialized_(false) {}
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <webserv/config/ServerConfig.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/config/LocationConfig.hpp>
|
||||
#include <webserv/config/utils.hpp>
|
||||
#include <webserv/log/Log.hpp>
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
#include <webserv/config/LocationConfig.hpp> // for LocationConfig
|
||||
#include <webserv/config/LocationConfig.hpp> // for LocationConfig
|
||||
#include <webserv/config/ServerConfig.hpp>
|
||||
#include <webserv/config/utils.hpp> // for findCorrespondingClosingBrace, trim
|
||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||
#include <stddef.h> // for size_t
|
||||
#include <sstream> // for basic_istringstream, basic_istream, istringstream
|
||||
#include <string> // for basic_string, char_traits, operator+, allocator, string, operator==, operator>>, operator<=>, to_string, stoi, getline
|
||||
#include <stdexcept> // for runtime_error
|
||||
#include <utility> // for pair
|
||||
#include <webserv/config/utils.hpp> // for findCorrespondingClosingBrace, trim
|
||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||
|
||||
#include <sstream> // for basic_istringstream, basic_istream, istringstream
|
||||
#include <stdexcept> // for runtime_error
|
||||
#include <string> // for basic_string, char_traits, operator+, allocator, string, operator==, operator>>, operator<=>, to_string, stoi, getline
|
||||
#include <utility> // for pair
|
||||
|
||||
#include <stddef.h> // for size_t
|
||||
|
||||
ServerConfig::ServerConfig(std::string const &serverBlock) : port_(80)
|
||||
{
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <webserv/config/LocationConfig.hpp>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include <webserv/config/utils.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string trim(const std::string &str)
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h> // for size_t
|
||||
#include <string> // for string
|
||||
#include <string> // for string
|
||||
|
||||
#include <stddef.h> // for size_t
|
||||
|
||||
std::string trimSemi(const std::string &str);
|
||||
std::string trim(const std::string &str);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include <webserv/config/utils.hpp> // for trim
|
||||
#include <webserv/http/HttpConstants.hpp> // for CRLF
|
||||
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
||||
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
||||
|
||||
#include <algorithm> // for __transform_fn, transform
|
||||
#include <utility> // for pair
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h> // for size_t
|
||||
#include <optional> // for optional
|
||||
#include <string> // for basic_string, string, hash
|
||||
#include <unordered_map> // for unordered_map
|
||||
#include <optional> // for optional
|
||||
#include <string> // for basic_string, string, hash
|
||||
#include <unordered_map> // for unordered_map
|
||||
|
||||
#include <stddef.h> // for size_t
|
||||
|
||||
/**
|
||||
* @file HttpHeaders.hpp
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
#include <webserv/http/HttpConstants.hpp> // for CRLF, DOUBLE_CRLF
|
||||
#include <webserv/http/HttpConstants.hpp> // for CRLF, DOUBLE_CRLF
|
||||
#include <webserv/http/HttpRequest.hpp>
|
||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||
#include <sstream> // for basic_stringstream, basic_istream, stringstream
|
||||
#include <vector> // for vector
|
||||
#include <exception> // for exception
|
||||
#include <optional> // for optional, operator>
|
||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||
|
||||
#include <exception> // for exception
|
||||
#include <optional> // for optional, operator>
|
||||
#include <sstream> // for basic_stringstream, basic_istream, stringstream
|
||||
#include <vector> // for vector
|
||||
|
||||
class ServerConfig;
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
#include <webserv/log/Channel.hpp>
|
||||
#include <iomanip> // for operator<<, setfill, setw
|
||||
#include <sstream> // for basic_ostream, operator<<, basic_stringstream, basic_istream, basic_istringstream, right, istringstream, stringstream
|
||||
#include <utility> // for get
|
||||
|
||||
#include <iomanip> // for operator<<, setfill, setw
|
||||
#include <sstream> // for basic_ostream, operator<<, basic_stringstream, basic_istream, basic_istringstream, right, istringstream, stringstream
|
||||
#include <utility> // for get
|
||||
|
||||
Log::Level Channel::getLogLevel() const
|
||||
{
|
||||
@ -24,12 +25,12 @@ std::string Channel::printContext(const std::map<std::string, std::string> &cont
|
||||
{
|
||||
|
||||
ss << "\t| " << std::right << std::setfill(' ') << "\e[1m" << key << "\e[0m" << " : \n";
|
||||
std::istringstream valueStream(value);
|
||||
std::string line;
|
||||
while (std::getline(valueStream, line))
|
||||
{
|
||||
ss << std::setw(10) << "\t\t| " << line << "\n";
|
||||
}
|
||||
std::istringstream valueStream(value);
|
||||
std::string line;
|
||||
while (std::getline(valueStream, line))
|
||||
{
|
||||
ss << std::setw(10) << "\t\t| " << line << "\n";
|
||||
}
|
||||
continue;
|
||||
}
|
||||
ss << "\t| " << std::right << std::setfill(' ') << "\e[1m" << key << "\e[0m" << " : " << value << "\n";
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <webserv/log/Log.hpp>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
#include <webserv/log/FileChannel.hpp>
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
#include <chrono> // for system_clock
|
||||
#include <iostream> // for cerr
|
||||
#include <iomanip> // for operator<<, put_time
|
||||
#include <ctime> // for localtime, tm
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
|
||||
#include <chrono> // for system_clock
|
||||
#include <ctime> // for localtime, tm
|
||||
#include <iomanip> // for operator<<, put_time
|
||||
#include <iostream> // for cerr
|
||||
|
||||
struct tm;
|
||||
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h> // for uint8_t
|
||||
#include <array> // for array
|
||||
#include <chrono> // for steady_clock
|
||||
#include <map> // for map
|
||||
#include <memory> // for unique_ptr
|
||||
#include <string> // for string, basic_string, hash
|
||||
#include <string_view> // for string_view
|
||||
#include <unordered_map> // for unordered_map
|
||||
#include <ios> // for ios_base
|
||||
#include <array> // for array
|
||||
#include <chrono> // for steady_clock
|
||||
#include <ios> // for ios_base
|
||||
#include <map> // for map
|
||||
#include <memory> // for unique_ptr
|
||||
#include <string> // for string, basic_string, hash
|
||||
#include <string_view> // for string_view
|
||||
#include <unordered_map> // for unordered_map
|
||||
|
||||
#include <stdint.h> // for uint8_t
|
||||
|
||||
class Channel; // Forward declaration
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
#include <webserv/log/StdoutChannel.hpp>
|
||||
#include <iomanip> // for operator<<, setfill, setw
|
||||
#include <iostream> // for basic_ostream, operator<<, basic_ostream::operator<<, cerr, cout, flush, ostream
|
||||
|
||||
#include <iomanip> // for operator<<, setfill, setw
|
||||
#include <iostream> // for basic_ostream, operator<<, basic_ostream::operator<<, cerr, cout, flush, ostream
|
||||
|
||||
StdoutChannel::StdoutChannel(Log::Level logLevel)
|
||||
{
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
|
||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||
#include <webserv/server/Server.hpp> // for Server
|
||||
#include <iostream> // for basic_ostream, operator<<, cerr, ios_base
|
||||
#include <string> // for basic_string, char_traits, allocator, operator+, operator<=>
|
||||
#include <map> // for map
|
||||
#include <utility> // for pair
|
||||
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
|
||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||
#include <webserv/server/Server.hpp> // for Server
|
||||
|
||||
#include <iostream> // for basic_ostream, operator<<, cerr, ios_base
|
||||
#include <map> // for map
|
||||
#include <string> // for basic_string, char_traits, allocator, operator+, operator<=>
|
||||
#include <utility> // for pair
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
@ -1,20 +1,22 @@
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
#include <webserv/client/Client.hpp> // for Client
|
||||
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
#include <webserv/server/Server.hpp>
|
||||
#include <webserv/socket/Socket.hpp> // for Socket
|
||||
#include <sys/epoll.h> // for epoll_event, epoll_ctl, EPOLLIN, EPOLLOUT, epoll_create1, epoll_wait, EPOLLERR, EPOLLHUP, EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD
|
||||
#include <sys/socket.h> // for send, SOMAXCONN
|
||||
#include <unistd.h> // for close
|
||||
#include <errno.h> // for errno
|
||||
#include <sys/types.h> // for ssize_t
|
||||
#include <webserv/client/Client.hpp> // for Client
|
||||
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
|
||||
#include <cstring> // for strerror, strlen
|
||||
#include <memory> // for unique_ptr, allocator, make_unique
|
||||
#include <vector> // for vector
|
||||
#include <exception> // for exception
|
||||
#include <stdexcept> // for runtime_error
|
||||
#include <string> // for operator+, to_string, basic_string, char_traits, string
|
||||
#include <utility> // for move, pair
|
||||
#include <webserv/socket/Socket.hpp> // for Socket
|
||||
|
||||
#include <cstring> // for strerror, strlen
|
||||
#include <exception> // for exception
|
||||
#include <memory> // for unique_ptr, allocator, make_unique
|
||||
#include <stdexcept> // for runtime_error
|
||||
#include <string> // for operator+, to_string, basic_string, char_traits, string
|
||||
#include <utility> // for move, pair
|
||||
#include <vector> // for vector
|
||||
|
||||
#include <errno.h> // for errno
|
||||
#include <sys/epoll.h> // for epoll_event, epoll_ctl, EPOLLIN, EPOLLOUT, epoll_create1, epoll_wait, EPOLLERR, EPOLLHUP, EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD
|
||||
#include <sys/socket.h> // for send, SOMAXCONN
|
||||
#include <sys/types.h> // for ssize_t
|
||||
#include <unistd.h> // for close
|
||||
|
||||
Server::Server(const ConfigManager &configManager) : epoll_fd_(epoll_create1(0)), configManager_(configManager)
|
||||
{
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
#include <webserv/log/Log.hpp>
|
||||
#include <webserv/socket/Socket.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <arpa/inet.h> // For inet_addr
|
||||
#include <fcntl.h> // For fcntl()"
|
||||
#include <netinet/in.h> // For sockaddr_in
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h> // For close()
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
||||
Socket::Socket() : fd_(socket(AF_INET, SOCK_STREAM, 0))
|
||||
{
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <sys/types.h> // for ssize_t
|
||||
#include <stddef.h> // for size_t
|
||||
#include <memory> // for unique_ptr
|
||||
#include <string> // for string
|
||||
#include <memory> // for unique_ptr
|
||||
#include <string> // for string
|
||||
|
||||
#include <stddef.h> // for size_t
|
||||
#include <sys/types.h> // for ssize_t
|
||||
|
||||
class Socket
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user