Thread: best way to store options? (memory and harddisk at the same time)

  1. #1
    Registered User
    Join Date
    Jul 2007

    best way to store options? (memory and harddisk at the same time)

    I am going to write a lightweight appointment manager. First just as console app as practice.

    Therefore I need to load some variables on program start from harddisk and store them in variables. The content of the variabels may change and this should be corrected on harddisk then too. Them might be also deleted.

    Any program which stores any settings works on that way. My question is now is there already some external library for all that? Some programs seam to user either windows registry (not portable), xml or ini.

    I "just" need a variable which will be also stored to the disk. Any advice?

  2. #2
    Registered User
    Join Date
    Nov 2006
    look at boost program options library. it's very easy to handle options given per command line or file with it.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Farncombe, Surrey, England
    If you only have a few appointments, you could simply store them in a plain text-file with your own format, such as:
    2007-09-12 10:30 11:00 Meeting to discusss the appointment project
    2007-09-12 12:00-13:00 Lunch with my wife
    2007-12-20 18:00-01:30 Office Christmas party.
    If the file is small enough, the time to parse, load and save, etc, will be sufficiently short that it's of no issue.

    Obviously, if you are doing an application for appointments to support a large organization (more than a dozen or so), a single textfile isn't useful, and storing large number of text-files will also be rather inefficient. In this case, a REAL database is needed. It doesn't have to be an SQL database, but certainly something using index tables and balanced trees or such.

    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's the best memory (RAM) type?
    By Unregistered in forum A Brief History of
    Replies: 17
    Last Post: 12-15-2001, 12:37 AM