[gtkada] configuration files

Preben Randhol randhol at pvv.org
Tue May 28 18:23:29 CEST 2002


manuel.op.de.coul at eon-benelux.com wrote on 28/05/2002 (14:38) :
> Preben wrote:
> >The program will be writing and reading the settings files so the
> >programmer knows the order in which the data comes.
> 
> We should allow for people to edit the ini file, including
> mixing up the order, IMO. If you read the file in memory and
> retrieve by key later this is not a problem. We could check
> for duplicate keys.

But I don't think we should allow sloppy config files. I mean I don't
see any reason why one should make a lot of functions that try to
interpret what the user wrote, but rater have a strict syntax and
complain if this is not followed.

Example

[Directory]
Some_Value=
10
Help=/usr/share/

1) Some_Value doesn't belong to Directory. We should then complain and
   not guess that it belongs to some other section.
2) Not allow whitespaces before after = 

The reason I want this is that this is exactly the problem with HTML
today. It is not strict which leads to web browsers that have to guess
what the user have done in the html file he made. I tested a browser
that followed the HTML spec and it couldn't display a loooot of pages
because they were all broken. So in order to display them as other
browsers do one had to make a lot of extra code which results in
crashes. Note it was not written in Ada, but C++. You can also see now
that W3M made XHTML so that PalmPilots with little CPU power can render
the pages easily.

-- 
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
                 «For me, Ada95 puts back the joy in programming.»




More information about the gtkada mailing list