[sword-devel] SWConfig clarification

Troy A. Griffitts sword-devel@crosswire.org
Tue, 11 Dec 2001 16:30:03 -0700

> In looking at the code in swconfig.cpp it appears as though the the
> Save() method iterates though all the sections saving their properties
> to a single file.

Yes.  This is correct.  swconfig works agains a single .conf file,
theoretically. That's is goal.  You can .augment the swconfig with
another swconfig but when you save the augmented config, it will place
all data into it's original config file.

SWMgr uses swconfig in a much more complicated way.  It knows that a
sword module set can be a series of .conf files in a mods.d directory,
or a single mods.conf file.  If it finds the mods.d directory, it
creates a single swconfig and augments all .conf file into this config. 
This augmented config file will never be .Save()'d  It would take much
more magic to allow modification and saving of this back to the original

> However, when I look in the .conf files in
> <install_dir>/mods.d/ they only have a single configuration entry per
> file. So which is correct, writing one file with all entries in it, or
> one file per section?
> Also, it looks as though the SWMgr is responsible for finding and then
> loading the configuration files. Is this correct?
> Thanks,
> /mike
> --
> ******************************************
>  Mike Dougherty -- Java Software Engineer
> ******************************************
>  Unprovided with original learning, unformed in the habits of thinking,
>  unskilled in the arts of composition, I resolved to write a book.
>                 -- Edward Gibbon