MoI's ini format
All  1  2-5

Previous
Next
 From:  Michael Gibson
4062.2 In reply to 4062.1 
Hi Burr, I haven't really thought about that...

One problem with XML is that it's a bit more verbose and "techy".

For example with that recent post I was able to tell Don to go to the [Commands] section and set UseDiameterDefault=y. That's pretty straightforward.

The equivalent in XML might be something like "Go to some particular tag that may be nested under another tag, maybe explain what tags are, that they must be closed, ...." It's kind of easy to break an XML structured file if you don't know what the rules are for how it has to be structured.

The .ini file being a kind of "flat" structure with option = value is pretty nice and simple. It's hard to break it, you can type in any kind of garbage on one line and it won't mess up the whole file.

Is there anything in particular that you're looking to gain by having the settings stored in XML rather than in .ini format?

I mean certainly XML is tremendously more flexible for storing structured and hierarchical data, repeated data patterns, and stuff like that, but the needs for just settings storage is pretty modest.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
4062.3 In reply to 4062.2 
Hi Michael, yeah, difinatly ini is human readable, and as you have users and settings in there it wouldnt be something to do, yet.. But in the future, if you are working on the UI customization stuff, and perhaps create some sort of editor for the settings (Making Brian very happy, RIP) then there could be a switch made.

""""""""Is there anything in particular that you're looking to gain by having the settings stored in XML rather than in .ini format?"""""

At this point, it's just having access to it for my development purposes...(Spoiled with newer tools that can automate xml better than me writing line parsing stuff) As it is now, I am converting it to xml to work with and test.

For future use, the possibilities are much greater for development, being able to tie into other types of services...

At this point, without the third party support (And more my limited knowledge of the current programming requirments) I am pursuing different methods for plugin access and development.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4062.4 In reply to 4062.3 
Hi Burr, there are Windows API calls you can use for reading stuff from .ini files, see GetPrivateProfileString:
http://msdn.microsoft.com/en-us/library/ms724353(VS.85).aspx

But yeah for customizable UI stuff that would more likely be in an XML file. Actually the layout of the main window is already stored in an XML file.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Jim (JIMCRAFTON)
4062.5 In reply to 4062.1 
Burr,
As a rule, unless there's a true burning need to have data that is hierarchical (i.e. some sort of parent child relationship), then xml is almost always overkill. Ini files are dead simple to parse, there are dozens of readers for them (in terms of code libraries) in most of the major programming languages, and they are easy to read and edit by hand. XML pretty much fails at all of those things. Since ini is just a text file it's also portable to pretty much anywhere.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1  2-5