I took that out for two main reasons. First it didn't
preserve any comments a user might have put into their
config files which is really irritating. I had some other
program modify one of my configs in linux a while back and
it stripped out all of my comments and what not. I was not
happy. :)
The other reason is that now that the config_reader has the
ability to have recursive sub blocks I didn't want to
clutter the interface with all the stuff you would need to
effectively modify/add/remove keys and blocks from a
config_reader object. I figured no one was even using it so
it would be better of if it wasn't around.
You might be better of just using an ofstream to write out
your config file, this way you can put comments or whatever
else you want into it. Of if the settings that your program
modifies are not things that a user is going to be editing
themselves via a text editor you would probably be better
off using some kind of object serialization. Like a
dlib::map<string,string> or whatever. All of the
containers are serializable now so you can make any kind of
complicated structure you want and just say
serialize(container,out_file_stream); and read it back in
later with deserialize().
But what exactly are you trying to do? All of the above is
just me guessing after all :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=1166290
I didn't think anyone was using that feature :)
I took that out for two main reasons. First it didn't
preserve any comments a user might have put into their
config files which is really irritating. I had some other
program modify one of my configs in linux a while back and
it stripped out all of my comments and what not. I was not
happy. :)
The other reason is that now that the config_reader has the
ability to have recursive sub blocks I didn't want to
clutter the interface with all the stuff you would need to
effectively modify/add/remove keys and blocks from a
config_reader object. I figured no one was even using it so
it would be better of if it wasn't around.
You might be better of just using an ofstream to write out
your config file, this way you can put comments or whatever
else you want into it. Of if the settings that your program
modifies are not things that a user is going to be editing
themselves via a text editor you would probably be better
off using some kind of object serialization. Like a
dlib::map<string,string> or whatever. All of the
containers are serializable now so you can make any kind of
complicated structure you want and just say
serialize(container,out_file_stream); and read it back in
later with deserialize().
But what exactly are you trying to do? All of the above is
just me guessing after all :)
Logged In: YES
user_id=569271
Just a bunch of key=value of things a user can edit in the program... The serialized map is a really good idea...
I'll use that one :)