Menu

#13 config not able to "dump_file" anymore

closed
Davis
5
2006-11-09
2006-11-08
No

Before (r5) it was possible to save the configuration
back to a file. Seems you removed that function? How
should I save my configuration again now?

Thanks

Discussion

  • Davis

    Davis - 2006-11-09

    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 :)

     
  • Davis

    Davis - 2006-11-09
    • assigned_to: nobody --> davisking
     
  • Steven Van Ingelgem

    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 :)

     
  • Davis

    Davis - 2006-11-09
    • labels: --> Change to Component
    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.