Prompt any site where at least something is working about ini files in C ++. Did not find any working script. Some left libraries are unknown from where, etc. Namely, how to work with them.
|
2 answers
If the program is supposed to be used only under Windows, then you can use the corresponding WinApi functions - http://en.wikipedia.org/wiki/INI_file#Accessing_INI_files
By the way, are you sure that you need the sections? Or, for example, the ability to list several values of a parameter? Because to write a parser for about this format
Parameter1 = 123 Parameter2 = 456 business for one evening maximum.
|
boost :: property_tree is your choice. example:
#include <iostream> #include <string> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ini_parser.hpp> int main() { std::istringstream ini(R"( [Badgers] weight = 10 color = Badger are grey and black. )"); boost::property_tree::ptree bar; boost::property_tree::ini_parser::read_ini(ini, bar); std::cout << bar.get<std::string>("Badgers.weight") << std::endl; std::cout << bar.get<std::string>("Badgers.color") << std::endl; return 0; } - Here it is more suitable. - Dimcheg
- @ Dmitry Astafiev, and cope with this accelerator ? - avp
|
grep mbstring /etc/php5/cli/php.inion the keyboard ... :-) - user6550