Thread: CFG/INI Format

  1. #1
    For Narnia! Sentral's Avatar
    Join Date
    May 2005
    Location
    Narnia
    Posts
    719

    CFG/INI Format

    As an example, say I want to save a player's profile name in one of these types of files. Is their an advantage of one to the other? Do these formats have specific formatting of the text inside to work properly, or can anything be saved, regardless of a specific syntax? I've seen this kind of stuff in .ini files:
    Code:
    [Player.Profile]
     PlayerName="Name"
    Does it even matter what format the text is arranged? Or is it just for organization?
    Videogame Memories!
    A site dedicated to keeping videogame memories alive!

    http://www.videogamememories.com/
    Share your experiences with us now!

    "We will game forever!"

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    It's for organization. If it's awkward to use, it's worthless. If you seen a .ini file for any program or game, its usually a bunch of "this=that" kinda stuff.

  3. #3
    For Narnia! Sentral's Avatar
    Join Date
    May 2005
    Location
    Narnia
    Posts
    719
    So it's the way you parse the file? I've seen INI parsers that follow the
    Code:
    [section] 
    var1=blah
    Is their an INI file format standards, that tells you how an INI file should be parsed?
    Videogame Memories!
    A site dedicated to keeping videogame memories alive!

    http://www.videogamememories.com/
    Share your experiences with us now!

    "We will game forever!"

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    On windows you have several functions to parse ini-files like
    GetPrivateProfileInt
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  6. #6
    For Narnia! Sentral's Avatar
    Join Date
    May 2005
    Location
    Narnia
    Posts
    719
    I see now. Anyone have any good C++ INI file parsers? I was using IniFile.h and IniFile.cpp, but there isn't much documentation.

    I figured it out.
    Last edited by Sentral; 12-23-2006 at 04:18 PM.
    Videogame Memories!
    A site dedicated to keeping videogame memories alive!

    http://www.videogamememories.com/
    Share your experiences with us now!

    "We will game forever!"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GradeInfo
    By kirksson in forum C Programming
    Replies: 23
    Last Post: 07-16-2008, 03:27 PM
  2. function returning hour in either 12 or 24 hour format
    By stanlvw in forum C Programming
    Replies: 4
    Last Post: 01-01-2008, 06:02 AM
  3. Compression/Decompression Wave File and MP3
    By cindy_16051988 in forum Projects and Job Recruitment
    Replies: 51
    Last Post: 04-29-2006, 06:25 AM
  4. Seeking Format Advice
    By PsychoBrat in forum Game Programming
    Replies: 3
    Last Post: 10-05-2005, 05:41 AM
  5. Can't Format C
    By caroundw5h in forum Tech Board
    Replies: 40
    Last Post: 04-26-2004, 09:57 AM