The Config Parser looks a lot better, cleaner, made a lot of decisions and added i think everything to the apropriate header files, now working on testing but since new install of Ubuntu testing make on something i expect is working, the main branch, so brb

This commit is contained in:
Me
2022-07-29 22:17:10 +02:00
parent 846c478142
commit 3ff62f5ddc
5 changed files with 152 additions and 91 deletions

View File

@@ -13,8 +13,9 @@
#ifndef SERVERCONFIG_HPP
# define SERVERCONFIG_HPP
// add includes properly...
# include "Webserv.hpp"
# include "LocationConfig.hpp"
//other includes
// a class that's all public? just so we have options?
class ServerConfig
@@ -51,6 +52,38 @@ public:
std::string host;
std::string port;
// do i need a print all for testing?
void print_all()
{
std::cout << "PRINTING A FULL SERVER CONFIG\n\n";
std::cout << "Server_name: " << server_name << '\n';
std::cout << "root: " << root << '\n';
std::cout << "index: ";
for (int i = 0; i < index.size(); i++)
std::cout << index[i] << " ";
std::cout << "\nerror_pages: ";
for (int i = 0; i < error_pages.size(); i++)
std::cout << error_pages.first << "--" << error_pages.second << " ";
std::cout << "\nallow_methods: ";
for (int i = 0; i < allow_methods.size(); i++)
std::cout << allow_methods[i] << " ";
std::cout << "\nskiping Locations for now...\n";
std::cout << "also skiping send_timeout and recv\n";
std::cout << "autoindex: " << autoindex << '\n';
std::cout << "client_body_limit: " << client_body_limit << '\n';
std::cout << "redirect_status: " << redirect_status << '\n';
std::cout << "redirect_uri: " << redirect_uri << '\n';
std::cout << "host: " << host << '\n';
std::cout << "port: " << port << '\n';
std::cout << "\n----------\n";
}
};