| 3 | #include <fstream> |
| 4 | |
| 5 | std::string trim(std::string const& source, char const* delims = " \t\r\n") { |
| 6 | std::string result(source); |
| 7 | std::string::size_type index = result.find_last_not_of(delims); |
| 8 | if(index != std::string::npos) |
| 9 | result.erase(++index); |
| 10 | |
| 11 | index = result.find_first_not_of(delims); |
| 12 | if(index != std::string::npos) |
| 13 | result.erase(0, index); |
| 14 | else |
| 15 | result.erase(); |
| 16 | return result; |
| 17 | } |
| 18 | |
| 19 | ConfigFile::ConfigFile(std::string const& configFile) { |
| 20 | std::ifstream file(configFile.c_str()); |