Modules
ADT Database GTK2 GUI IP PiJAX Public Sql Stdio Subversion System Tools Xosd lua v4l2 wx
Recent Changes
Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0
Popular Downloads
Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48
|
Pike Module Reference: module version 1, prepared
MODULE Public |
Modules Tools
|
|
MODULE Public.Tools.ConfigFiles |
Modules Config
|
|
MODULE Public.Tools.ConfigFiles.Config |
Methods format_section() get_section_names() read() write() write_section()
|
Description
A class for reading and writing "ini" style files.
-
Method format_section
string Public.Tools.ConfigFiles.Config.format_section(string section, mapping attributes)
-
Method read
mapping Public.Tools.ConfigFiles.Config.read(string contents)
- Description
converts an ini-file string into a mapping of section names
to section configuration contents.
a section name must be unique within a given file, however
a section may contain multiple entries with the same key. in
such a situation, the key will point to an array containing the
values in the order in which they were encountered in the
configuration file.
- Parameter contents
a string containing the contents of an ini file.
-
Method write
string Public.Tools.ConfigFiles.Config.write(mapping config, array|void order)
- Description
formats a configuration mapping, such as one produced by read,
into the ini file format.
- Parameter config
the configuration mapping
- Parameter order
an optional array containing section names in the order in which
they should be added to the resulting string.
- Returns
a string in the ini file format.
-
Method get_section_names
array Public.Tools.ConfigFiles.Config.get_section_names(string contents)
- Description
get a list of configuration sections from an ini formatted string
- Parameter contents
a string containing an ini-formatted string
-
Method write_section
int Public.Tools.ConfigFiles.Config.write_section(string file, string section, mapping attributes)
- Description
writes a section to a configuration file, replacing the corresponding
section, if it exists. makes a backup of the old file before writing
the new file. note that this method will remove any existing comments
or formatting from the file on disk.
- Parameter file
the name of the file to read/write
- Parameter section
the name of the section to write
- Parameter attributes
the section of configuration to write.
|
|