clean comment and stuff

This commit is contained in:
lperrey
2022-08-18 12:44:09 +02:00
parent 9b0fcc1520
commit 469eca8aa9
27 changed files with 100 additions and 325 deletions

View File

@@ -1,16 +1,13 @@
#include "ConfigParser.hpp"
// should i be sending & references?
// const?
std::string ConfigParser::_pre_set_val_check(const std::string key,
const std::string value)
std::string ConfigParser::_pre_set_val_check(const std::string &key,
const std::string &value) const
{
// check key for ;
// check values for ; at end and right number of words depending on key
// std::cout << "pre check\n";
if (key.find_first_of(";") != NPOS)
throw std::invalid_argument("bad config file arguments");
@@ -30,9 +27,8 @@ std::string ConfigParser::_pre_set_val_check(const std::string key,
return (value.substr(0, i));
}
// const?
// assumes curr is on a space or \t or \n
std::string ConfigParser::_get_first_word(size_t *curr)
std::string ConfigParser::_get_first_word(size_t *curr) const
{
size_t start;
@@ -45,9 +41,8 @@ std::string ConfigParser::_get_first_word(size_t *curr)
return (key);
}
// const?
// also assumes curr is on a space \t or \n
std::string ConfigParser::_get_rest_of_line(size_t *curr)
std::string ConfigParser::_get_rest_of_line(size_t *curr) const
{
size_t start;