Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ - parameter question

I am looking for some simple and efficient parameter container that would act like a in-memory-xml file representation (or ini-file, as another sample).

I mean, basically it could store sections and sets of parameters for each section, have easy accessors like GetValue("ParameterName") and simple return value casting.

It would be great if it is serializable.

I wrote something like that yesterday and, well, it suits my needs, but probably there is something more convenient and flexible available?

Maybe some kind of parameter map in boost?

Thank you

like image 389
Yippie-Ki-Yay Avatar asked Dec 07 '22 02:12

Yippie-Ki-Yay


1 Answers

Take a look at boost::program_options. It does what you want and more: INI file parsing, environment variables parsing, commandline options parsing and extensibility.

like image 89
wilhelmtell Avatar answered Dec 11 '22 09:12

wilhelmtell