clean comment and stuff
This commit is contained in:
@@ -14,46 +14,41 @@
|
||||
# include <cstdlib> // strtol, stroul
|
||||
# include <iostream> // cout, cin
|
||||
# include <fstream> // ifstream
|
||||
# include <sys/stat.h> // stat(), replaces opendir() don't bother with ERRNO ?
|
||||
# include <algorithm> // sort() in Post
|
||||
|
||||
class ConfigParser {
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
ConfigParser();
|
||||
~ConfigParser();
|
||||
ConfigParser(const std::string &config_file);
|
||||
ConfigParser();
|
||||
~ConfigParser();
|
||||
ConfigParser(const std::string &config_file);
|
||||
|
||||
void read_config(const std::string &config_file);
|
||||
void read_config(const std::string &config_file);
|
||||
|
||||
std::vector<ServerConfig> * parse(); // const?
|
||||
std::vector<ServerConfig> *parse() const;
|
||||
|
||||
void print_content() const;
|
||||
|
||||
// i thought if it were an instance of this class you could call
|
||||
// private member functions from anywhere... // QUESTION : Wut ?
|
||||
void print_content() const;
|
||||
private:
|
||||
std::string _content;
|
||||
|
||||
ServerConfig _parse_server(size_t *start) const;
|
||||
LocationConfig _parse_location(size_t *start) const;
|
||||
|
||||
private:
|
||||
std::string _content;
|
||||
void _set_server_values(ServerConfig *server, const std::string &key, std::string value) const;
|
||||
void _set_location_values(LocationConfig *location, const std::string &key, std::string value) const;
|
||||
|
||||
ServerConfig _parse_server(size_t *start);
|
||||
LocationConfig _parse_location(size_t *start);
|
||||
/* Extra */
|
||||
std::string _pre_set_val_check(const std::string &key,
|
||||
const std::string &value) const;
|
||||
|
||||
void _set_server_values(ServerConfig *server, const std::string key, std::string value);
|
||||
void _set_location_values(LocationConfig *location, const std::string key, std::string value);
|
||||
std::string _get_first_word(size_t *curr) const;
|
||||
std::string _get_rest_of_line(size_t *curr) const;
|
||||
|
||||
/* Extra */
|
||||
std::string _pre_set_val_check(const std::string key,
|
||||
const std::string value);
|
||||
|
||||
std::string _get_first_word(size_t *curr); // const?
|
||||
std::string _get_rest_of_line(size_t *curr); // const?
|
||||
|
||||
/* Post Processing */
|
||||
void _post_processing(std::vector<ServerConfig> *servers);
|
||||
bool _find_root_path_location(std::vector<LocationConfig> locations) const;
|
||||
/* Post Processing */
|
||||
void _post_processing(std::vector<ServerConfig> *servers) const;
|
||||
bool _find_root_path_location(std::vector<LocationConfig> locations) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user