Class Fox::FXSettings
In: rdoc-sources/FXSettings.rb
lib/fox12/core.rb
Parent: FXDict

FXSettings is a key-value database. This is normally used as part of FXRegistry, but can also be used separately in application that need to maintain a key-value database of their own.

Methods

Public Class methods

Return an initialized FXSettings instance.

Public Instance methods

Obtain the string dictionary (an FXStringDict instance) for the requested section number.

Parameters:

pos:the section number of interest [Integer]

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]

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]

Iterate over sections (where each section is a dictionary).

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]

Returns true if the named section exists.

Parameters:

section:the name of the section of interest [String]

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]

Mark as changed.

Returns true if this settings object has been modified.

Parse a file containing a settings database. Returns true on success, false otherwise.

Read a boolean registry entry from the specified section and key. If no value is found, the default value is returned.

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]

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]

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]

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]

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]

Unparse settings database into given file. Returns true on success, false otherwise.

Write a boolean registry value to the specified section and key.

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]

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]

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]

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]

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]

[Validate]