Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]

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.2, prepared

  MODULE module
Modules
Config

  MODULE module.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 module.Config.format_section(string section, mapping attributes)


Method read

mapping module.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 module.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 module.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 module.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.

gotpike.org | Copyright © 2004 - 2019 | Pike is a trademark of Department of Computer and Information Science, Linköping University