24 lines
535 B
C++
24 lines
535 B
C++
#ifndef INI_PARSER_HPP
|
|
#define INI_PARSER_HPP
|
|
|
|
#include <fstream>
|
|
#include <string>
|
|
#include <map>
|
|
|
|
class INIParser {
|
|
public:
|
|
INIParser();
|
|
INIParser(const std::string& filename);
|
|
void parse();
|
|
std::string getValue(const std::string& section, const std::string& key);
|
|
std::string getKey(const std::string& section);
|
|
std::string getSection();
|
|
~INIParser();
|
|
private:
|
|
std::ifstream m_file;
|
|
std::map<std::string, std::map<std::string, std::string>> m_sections;
|
|
void m_deleteSpace(std::string& line);
|
|
};
|
|
|
|
#endif // INI_PARSER_HPP
|