[gtkada] configuration files

Ebert, Rolf rolf.ebert at bms.de
Wed May 29 15:28:47 CEST 2002


I think we should split the discussion into two areas:

A) functionality that has to be provided to clients of the package
B) file (database) format of the actual configuration file

Defining the functionality (A) leads to the design of a specification file.

Defining the file format (B) defines the requirements for the implementation
of the body.

Some of the requirements for A:

A.1: The underlying file format shall not be implied by the spec file

A.2: A hierarchy of keys shall be possible
Note: The top level hierarchy is usually called section by now.

A.3: Multiple levels of hierarchy are preferable (I do not think that 
     there is consensus on this one)

A.4: All values shall be accessible as strings at least

A.5: A list of keys available in a given section shall be retrievable

A.6: others...

I do not like the idea to write values back to a configuration file.  I
would place the writing routines in  child package or leave them out
completely.


Notes on B:
I think we can write multiple bodies for the different file formats.  I can
even imagine a heursitic that at least the reading routines detect the file
format automatically.

I like the idea of the 

   Section "Directory"
   EndSection

format.  This looks quite similar to Ada itself.  Is it possible to have
nested sections.  How do they look like? 

As an aside: has anybody looked at the file format for the gnat project
files as of gcc-3.1.  This is almost pure Ada!


	Rolf Ebert




More information about the gtkada mailing list