|
NAMEConfiguration -reads the configuration file and manages it in memory. SYNOPSIS#include <Configuration.h> Configuration config; ConfigDefault config_defaults = { { "verbose", "true" }, { 0, 0 } }; config.Defaults(config_defaults); config.Read("/spare2/myconfig") ; config.Add("sync", "false"); if(config["sync"]) ... if(config.Value("rate") < 50) ... if(config.Boolean("sync")) ... DESCRIPTIONThe primary purpose of the Configuration class is to parse a configuration file and allow the application to modify the internal data structure produced. All values are strings and are converted by the appropriate accessors. For instance the Boolean method will return numerical true (not zero) if the string either contains a number that is different from zero or the string trueThe ConfigDefaults type is a structure of two char pointers: the name of the configuration attribute and it's value. The end of the array is the first entry that contains a null pointer instead of the attribute name. Numerical values must be in strings. For instance: ConfigDefault* config_defaults = { { "wordlist_compress", "true" }, { "wordlist_page_size", "8192" }, { 0, 0 } };The additional fields of the ConfigDefault are purely informative. FILE FORMATThe configuration file is a plain ASCII text file. Each line in the file is either a comment or an attribute. Comment lines are blank lines or lines that start with a '#'. Attributes consist of a variable name and an associated value:
<name>:<whitespace><value><newline>
The <name> contains any alphanumeric character or underline (_) The <value> can include any character except newline. It also cannot start with spaces or tabs since those are considered part of the whitespace after the colon. It is important to keep in mind that any trailing spaces or tabs will be included. It is possible to split the <value> across several lines of the configuration file by ending each line with a backslash (. The effect on the value is that a space is added where the line split occurs. A configuration file can include another file, by using the special <name>, <tt>include</tt>. The <value> is taken as the file name of another configuration file to be read in at this point. If the given file name is not fully qualified, it is taken relative to the directory in which the current configuration file is found. Variable expansion is permitted in the file name. Multiple include statements, and nested includes are also permitted.
include: common.conf
METHODS
AUTHORSLoic Dachary loic@gnu.orgThe Ht://Dig group http://dev.htdig.org/ SEE ALSOhtdb_dump(1), htdb_stat(1), htdb_load(1), mifluzdump(1), mifluzload(1), mifluzsearch(1), mifluzdict(1), WordContext(3), WordList(3), WordDict(3), WordListOne(3), WordKey(3), WordKeyInfo(3), WordType(3), WordDBInfo(3), WordRecordInfo(3), WordRecord(3), WordReference(3), WordCursor(3), WordCursorOne(3), WordMonitor(3), mifluz(3)
Visit the GSP FreeBSD Man Page Interface. |