61 lines
1.7 KiB
C++
61 lines
1.7 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ConfigParser.hpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: me <erlazo@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/07/11 23:01:41 by me #+# #+# */
|
|
/* Updated: 2022/07/25 20:56:53 by me ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef CONFIGPARSER_HPP
|
|
# define CONFIGPARSER_HPP
|
|
|
|
# include "Webserv.hpp" // easier to just do this?
|
|
|
|
|
|
class ConfigParser {
|
|
|
|
public:
|
|
|
|
// canonical
|
|
|
|
ConfigParser(const char* path); // a string?
|
|
~ConfigParser();
|
|
|
|
// ideally i wouldn't have one cuz it makes no sense, when would i use it?
|
|
// ConfigParser & operator=(const ConfigParser& rhs);
|
|
|
|
// void parse(); // return void cuz throw exceptions.
|
|
std::vector<Server> * parse(); // const?
|
|
|
|
// other parses?
|
|
|
|
|
|
private:
|
|
std::string _content;
|
|
|
|
// explicit?
|
|
// what exaclty does explicit do again?
|
|
ConfigParser(); // might need a path as arg?
|
|
// should this be in private since it always needs a path?
|
|
|
|
|
|
void _check_proper_line_end(size_t prev, size_t curr); // const?
|
|
|
|
int _check_for_semicolon(std::string line); // const?
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|