well i think i have the Config Parser working and pretty clean, there might be a few tweaks here and there but looks good, now to integrate it with Webserv

This commit is contained in:
Me
2022-07-30 21:08:21 +02:00
parent a5fa5462d4
commit 665623c7ee
8 changed files with 318 additions and 144 deletions

View File

@@ -20,20 +20,28 @@ int main(int ac, char **av)
configParser._print_content();
// std::vector<ServerConfig>* servers = configParser.parse();
// i don't love that servers has to be a pointer...
std::vector<ServerConfig>* servers = configParser.parse();
// for (size_t i = 0; i < servers->size(); i++)
// servers[i]->print_all();
// use an iterator you moron
for (std::vector<ServerConfig>::iterator it = servers->begin(); it < servers->end(); it++)
{
// std::cout << it->server_name << " ";
it->print_all();
}
// Webserv serv(configParser.parse());
// is this better or worse than using
// serv.init_virtual_servers();
// serv.start();
delete servers;
}
catch (std::exception& e)
{
std::cout << e.what() << '\n';
}
return (0);
}