1inifile(n)               Parsing of Windows INI files               inifile(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       inifile - Parsing of Windows INI files
9

SYNOPSIS

11       package require Tcl  8.2
12
13       package require inifile  ?0.3.1?
14
15       ::ini::open file ?-encoding encoding? ?access?
16
17       ::ini::close ini
18
19       ::ini::commit ini
20
21       ::ini::revert ini
22
23       ::ini::filename ini
24
25       ::ini::sections ini
26
27       ::ini::keys ini section
28
29       ::ini::get ini section
30
31       ::ini::exists ini section ?key?
32
33       ::ini::value ini section key ?default?
34
35       ::ini::set ini section key value
36
37       ::ini::delete ini section ?key?
38
39       ::ini::comment ini section ?key? ?text?
40
41       ::ini::commentchar ?char?
42
43______________________________________________________________________________
44

DESCRIPTION

46       This package provides an interface for easy manipulation of Windows INI
47       files.
48
49       ::ini::open file ?-encoding encoding? ?access?
50              Opens an INI file and returns a handle that  is  used  by  other
51              commands.   access  is the same as the first form (non POSIX) of
52              the open command, with the exception that mode  a  is  not  sup‐
53              ported. The default mode is r+.
54
55              The default encoding is the system encoding.
56
57       ::ini::close ini
58              Close  the  specified  handle.  If any changes were made and not
59              written by commit they are lost.
60
61       ::ini::commit ini
62              Writes the file and all changes to disk. The sections are  writ‐
63              ten  in  arbitrary  order.  The keys in a section are written in
64              alphabetical order. If the ini was opened in read only  mode  an
65              error will be thrown.
66
67       ::ini::revert ini
68              Rolls  all  changes  made to the inifile object back to the last
69              committed state.
70
71       ::ini::filename ini
72              Returns the name of the file the ini object is associated with.
73
74       ::ini::sections ini
75              Returns a list of all the names of the existing sections in  the
76              file handle specified.
77
78       ::ini::keys ini section
79              Returns  a  list  of  all they key names in the section and file
80              specified.
81
82       ::ini::get ini section
83              Returns a list of key value pairs that exist in the section  and
84              file specified.
85
86       ::ini::exists ini section ?key?
87              Returns  a  boolean value indicating the existance of the speci‐
88              fied section as a whole or the specified key  within  that  sec‐
89              tion.
90
91       ::ini::value ini section key ?default?
92              Returns  the  value  of the named key and section. If specified,
93              the default value will be returned if the key does not exist. If
94              the key does not exist and no default is specified an error will
95              be thrown.
96
97       ::ini::set ini section key value
98              Sets the value of the key in the specified section. If the  sec‐
99              tion does not exist then a new one is created.
100
101       ::ini::delete ini section ?key?
102              Removes  the  key or the entire section and all its keys. A sec‐
103              tion is not automatically deleted when it has no remaining keys.
104
105       ::ini::comment ini section ?key? ?text?
106              Reads and modifies comments for sections and keys.  To  write  a
107              section  comment  use an empty string for the key. To remove all
108              comments use an empty string for text.  text may  consist  of  a
109              list  of lines or one single line. Any embedded newlines in text
110              are properly handled.  Comments may be  written  to  nonexistant
111              sections or keys and will not return an error. Reading a comment
112              from a nonexistant section or key will return an empty string.
113
114       ::ini::commentchar ?char?
115              Reads and sets the comment character. Lines that begin with this
116              character are treated as comments. When comments are written out
117              each line is preceded by this character. The default is ;.
118

BUGS, IDEAS, FEEDBACK

120       This document, and the package it describes, will  undoubtedly  contain
121       bugs and other problems.  Please report such in the category inifile of
122       the  Tcllib  Trackers  [http://core.tcl.tk/tcllib/reportlist].   Please
123       also  report any ideas for enhancements you may have for either package
124       and/or documentation.
125
126       When proposing code changes, please provide unified diffs, i.e the out‐
127       put of diff -u.
128
129       Note  further  that  attachments  are  strongly  preferred over inlined
130       patches. Attachments can be made by going  to  the  Edit  form  of  the
131       ticket  immediately  after  its  creation, and then using the left-most
132       button in the secondary navigation bar.
133

CATEGORY

135       Text processing
136
137
138
139tcllib                               0.3.1                          inifile(n)
Impressum