Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- class TestParse
- {
- public:
- TestParse()
- {}
- bool parseConfigFile(std::string const& filename)
- {
- int i(0);
- std::ifstream is(filename.c_str());
- std::string line;
- while(std::getline(is, line))
- {
- // Handle empty lines and comments
- if(line.empty() || line[0] == '#')
- {
- continue;
- }
- if(line[0] == '[')
- {
- ++i;
- continue;
- }
- ++i;
- }
- }
- };
- int main(int argc, char **argv)
- {
- TestParse test;
- test.parseConfigFile("/path/to/projectfile/project.kdev4");
- std::cout << "Hello, world!" << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement