An .ini parser in C++ for parsing ini configuration files. All in one header file and support multiple levels
C++
Latest commit a38c9f4 Jun 1, 2016 @Poordeveloper Merge pull request #4 from VladEvka/master
Add MIT License in header
Permalink
Failed to load latest commit information.
README.md Update README.md Jul 29, 2014
ini.hpp Update ini.hpp May 27, 2016
test.cpp add test.cpp Dec 24, 2012

README.md

.ini parser

An .ini parser in C++ for parsing ini configuration files. All in one header file and support multiple levels.

example:

void test1()
{
  std::stringstream ss;

  ss << 
    "a=1\n"
    "b=1\n\n"
    "[e]\n"
    "ea=1\n"
    "eb=1\n\n"
    "[c]\n"
    "ca=2\n"
    "cb=2\n\n"
    "[[d]]\n"
    "da=3\n"
    "db=3\n\n"
    "[A]\n"
    "Aa=4\n"
    "Ab=4\n";

  INI::Parser p(ss);
  std::stringstream out;
  p.dump(out);
  assert(out.str() == ss.str());

  assert(p.top()["a"]=="1");
  assert(p.top()("e")["ea"]=="1");
}

Please check INI::Parser::dump function for iteration in original order.

License

Distributed under the MIT license.