class Standard . ParseParameterFile {
string currentSectionName;
assoc dataBySection;
any defaultStorageFile;
int32 lineCount;
any serviceName;
oid sleepingThread;
} inherits from Object;
The class ParseParameterFile can read/write/query small database files of attribute value pairs. Each file can be broken into sections, providing a two-level hierarchy. A ParseParameterFile can also be registered as a named service, allowing convenient treatment as a globally accessible database.
ParseParameterFile:create(any ioObj, string servName)
See initialize.
ParseParameterFile:initialize(any ioObj, string servName)
ParseParameterFile:getSectionData(string sectionName, string key)
If no arguments are present, the entire database contents are returned as an associative array; otherwise, data associated with the section identified by sectionName will be returned. If sectionName is the null string, the default section is used. If the indicated section does not exist, nil will be returned. The second argument, key, is also optional. If not present, all of the data of the indicated section will be returned; otherwise, only the indicated element will be returned.
ParseParameterFile:addEntry(string sectionName, string key, any value)
Adds a new attribute/value entry to the section indicated by sectionName. If sectionName is the null string, the default section is used.
ParseParameterFile:addEntries(string sectionName, assoc vals)
Adds a collection of attribute/value pairs to the section indicated by sectionName. If sectionName is the null string, the default section is used. The attribute names are obtained from the subscripts of the associative array vals; the values are taken from the corresponding entries.
ParseParameterFile:deleteEntry(string sectionName, string key)
Deletes an attribute value pair whose name is specified as key from the section identified by sectionName. If sectionName is the null string, the default section is used.
ParseParameterFile:deleteSection(string sectionName)
Deletes from the database an entire section, whose name is specified by sectionName. If sectionName is the null string, the default section is used.
ParseParameterFile:getSectionNames()
Returns an array of section names that are defined by the database.
ParseParameterFile:dumpToFile(any file)
Writes the contents of the database to a file or open IOobject. If the file parameter is a string, it is treated as a file name, which will be used as an argument to create an IOobject. The file name can be specified using the "file:" scheme or a just a plain file name. If the file parameter is an object Id, it is used directly.