Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module Fox
#
# The Settings class manages a key-value database. This is normally used as
# part of Registry, but can also be used separately in applications that need
# to maintain a key-value database in a file of their own.
# String values can contain any character, and will be escaped when written
# to the file.
#
class FXSettings < FXDict
#
# Return an initialized FXSettings instance.
#
def initialize # :yields: theSettings
end
#
# Parse a file containing a settings database.
# Returns true on success, false otherwise.
#
def parseFile(filename, mark); end
#
# Unparse settings database into given file.
# Returns true on success, false otherwise.
#
def unparseFile(filename) ; end
#
# Obtain the string dictionary (an FXStringDict instance) for the requested section number.
#
# ==== Parameters:
#
# +pos+:: the section number of interest [Integer]
#
def data(pos) ; end
#
# Find a section given its name.
# Returns the section (an FXStringDict instance) if found,
# otherwise returns nil.
#
# ==== Parameters:
#
# +section+:: the section name of interest [String]
#
def find(section) ; end
#
# Iterate over sections (where each section is a dictionary).
#
def each_section # :yields: aStringDict
end
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
#
# Read a string registry entry from the specified _section_ and _key_.
# If no value is found, the _default_ value is returned.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for the setting of interest [String]
# +default+:: the default value to return if _key_ is not found [String]
#
def readStringEntry(section, key, default="") ; end
#
# Read an integer registry entry from the specified _section_ and _key_.
# If no value is found, the _default_ value is returned.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for the setting of interest [String]
# +default+:: the default value to return if _key_ is not found [Integer]
#
def readIntEntry(section, key, default=0) ; end
#
# Read an unsigned integer registry entry from the specified _section_ and _key_.
# If no value is found, the _default_ value is returned.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for the setting of interest [String]
# +default+:: the default value to return if _key_ is not found [Integer]
#
def readUnsignedEntry(section, key, default=0) ; end
#
# Read a double-precision floating point registry entry from the specified _section_ and _key_.
# If no value is found, the _default_ value is returned.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for the setting of interest [String]
# +default+:: the default value to return if _key_ is not found [Float]
#
def readRealEntry(section, key, default=0.0) ; end
#
# Read a color value registry entry from the specified _section_ and _key_.
# If no value is found, the _default_ value is returned.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for the setting of interest [String]
# +default+:: the default value to return if _key_ is not found [FXColor]
#
def readColorEntry(section, key, default=0) ; end
#
# Read a boolean valued registry entry from the specified _section_ and _key_.
# If no value is found, the _default_ value is returned.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for the setting of interest [String]
# +default+:: the default value to return if _key_ is not found [true or false]
#
def readBoolEntry(section, key, default=false) ; end
#
# Write a string registry _value_ to the specified _section_ and _key_.
# Returns true on success, false otherwise.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for this setting [String]
# +value+:: the value for this setting [String]
#
def writeStringEntry(section, key, value) ; end
#
# Write an integer registry _value_ to the specified _section_ and _key_.
# Returns true on success, false otherwise.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for this setting [String]
# +value+:: the value for this setting [Integer]
#
def writeIntEntry(section, key, value) ; end
#
# Write an unsigned integer registry _value_ to the specified _section_ and _key_.
# Returns true on success, false otherwise.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for this setting [String]
# +value+:: the value for this setting [Integer]
#
def writeUnsignedEntry(section, key, value) ; end
#
# Write a double-precision floating point registry _value_ to the specified _section_ and _key_.
# Returns true on success, false otherwise.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for this setting [String]
# +value+:: the value for this setting [Float]
#
def writeRealEntry(section, key, value) ; end
#
# Write a color registry _value_ to the specified _section_ and _key_.
# Returns true on success, false otherwise.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for this setting [String]
# +value+:: the value for this setting [FXColor]
#
def writeColorEntry(section, key, value) ; end
#
# Write a boolean registry _value_ to the specified _section_ and _key_.
# Returns true on success, false otherwise.
#
# ==== Parameters:
#
# +section+:: the section name [String]
# +key+:: the key for this setting [String]
# +value+:: the value for this setting [true or false]
#
def writeBoolEntry(section, key, value) ; end
#
# Delete the registry entry for the specified _section_ and _key_.
# Returns true on success, false otherwise.
#
# ==== Parameters:
#
# +section+:: the section containing the key to be deleted [String]
# +key+:: the key to be deleted [String]
#
def deleteEntry(section, key) ; end
#
# Returns +true+ if a registry entry exists for the specified _section_ and _key_.
#
# ==== Parameters:
#
# +section+:: the section containing the key of interest [String]
# +key+:: the key of interest [String]
#
def existingEntry?(section, key) ; end
#
# Delete an entire section from this settings database.
# Returns true on success, false otherwise.
#
# ==== Parameters:
#
# +section+:: the name of the section to be deleted [String]
#
def deleteSection(section) ; end
#
# Returns +true+ if the named _section_ exists.
#
# ==== Parameters:
#
# +section+:: the name of the section of interest [String]
#
def existingSection?(section) ; end
#
# Mark as changed.
#
def modified=(mdfy=true) ; end
#
# Returns +true+ if this settings object has been modified.
#
def modified? ; end
end
end