#include #include #ifdef BOOST_NO_STRINGSTREAM typedef std::istrstream istringstream; #else typedef std::istringstream istringstream; #endif void config_usage() { // Config can be used without creating config_manager instance // First step - create config with desired parser ctlib::config<> a_conf(new ctlib::plain_parser(new std::istringstream("key1=val1\nkey2=val2"))); // Seconf step - invoke parse a_conf.parse(); // Ready for use std::cout << "Key1='" << a_conf.get("key1", "") << "'" << std::endl; std::cout << "Key2='" << a_conf.get("key2", "") << "'" << std::endl; } int main() { config_usage(); return 0; }