Model Railroad System
2.2.2
|
The Read Configuration File code is contained in this namespace. More...
Functions | |
ReadConfiguration (filename, configurationArrayName) | |
This procedure reads in the configuration file named by the filename into the array named by configurationArrayName. More... | |
IsEven (i) | |
Checks if its argument is an even number. More... | |
WriteConfiguration (filename, configurationArrayName) | |
This procedure writes the configuration contianed in configurationArrayName to the file named by the filename. More... | |
ConfigurationType (...) | |
This macro defines the body of a snit::type that implements a program's global configuration (or preferences). More... | |
ReadConfiguration::ConfigurationType | ( | ... | ) |
This macro defines the body of a snit::type that implements a program's global configuration (or preferences).
The argument list is a set of configuration variable defination lists. Each list contains four elements: the label, the key list name (a one or two element list), the type (one of directory, infile, outfile, string, enumerated, integer, double, or color), and the default value. Enumerated types have an additional (fifth) element, the set of possible values. Numerical types (double and integer) have a range of values as a fifth element. This macro should only be called inside a snit::type defination.
The configuration (aka preferences) are stored in the user's home directory. The file name under UNIX (including MacOSX) starts with a dot and contains the application rootname (from argv0). Under MS-Windows, the file name does not start with a dot. Instead .rc is appended.
... | The configuration variable definitions. |
Type methods defined:
References FileEntry::cget(), ReadConfiguration(), and WriteConfiguration().
ReadConfiguration::IsEven | ( | i | ) |
Checks if its argument is an even number.
i | Value to check. |
ReadConfiguration::ReadConfiguration | ( | filename | , |
configurationArrayName | |||
) |
This procedure reads in the configuration file named by the filename into the array named by configurationArrayName.
filename | The name of the configuration file. |
configurationArrayName | The name of the array to hold the configuration. |
Referenced by ConfigurationType().
ReadConfiguration::WriteConfiguration | ( | filename | , |
configurationArrayName | |||
) |
This procedure writes the configuration contianed in configurationArrayName to the file named by the filename.
filename | The name of the configuration file. |
configurationArrayName | The name of the array holding the configuration. |
Referenced by ConfigurationType().