Carapace

Registry Class

The Registry object provides access to the system registry. The system registry houses all configuration for Carapace and for a vast number of other systems.

The system registry is simply a hierarchical database -- at the top level are a set of hives. Each hive then consists of sections and attributes. Each attribute can have a value. In addition, a section can itself have a default value. Every value has a type -- the most common being string and integer values.

Using a Carapace Registry object you can traverse the registry, accessing data as required.

Registry Hives

The complete list of hive names is as follows:

namedescription
ClassesRoot information on COM classes and servers
CurrentUser information particular to the user who is currently logged on
LocalMachine information common to the entire machine -- ie. independent of particular users
Users information about users
CurrentConfig current configuration information
DynamicData dynamic or performance-related information

Registry Creation

The create function is used to create a Registry object. The first way is to supply the desired section underneath the HKEY_CURRENT_USER hive:

    (create Registry "software/Carapace")
The above example gains you access to the software/Carapace section, which holds the Carapace configuration.

An explicit hive name can be supplied eg.

    (create Registry "software/Carapace" "LocalMachine")

Registry Properties

property name property type description
hive String name of the current registry hive
section String name of the current registry section

Registry Methods

method name description
set set the value for an attribute within the current section
get get the value for an attribute within the current section
sections list the sub-sections of the current section
attributes list the attributes in the current section
values fill the supplied HashTable with the attributes and values from the current section
createSection create a sub-section within the current section
deleteSection delete a sub-section within the current section
moveTo move to a different section
moveUp move up to the parent section
attributeExists determine if such an attribute exists in the current section
sectionExists determine if such a sub-section exists in the current section


set

Set the value for an attribute within the current section. If the supplied attribute name is the empty string, then the default value for the section is assigned.

Arguments:

attributeString
valueObject

Return type: the empty List ()


get

Get the value for an attribute within the current section. If there is no such attribute, the empty List () is returned.

Arguments:

attributeString

Return type: Object


sections

List the sub-sections of the current section.

Arguments: none

Return type: List of strings


attributes

List the attributes in the current section.

Arguments: none

Return type: List of strings


values

Fill the supplied HashTable with the attributes and values from the current section.

Arguments:

tblHashTable

Return type: the empty List ()


createSection

Create a sub-section within the current section.

Arguments:

sectionNameString

Return type: the empty List ()


deleteSection

Delete a sub-section within the current section.

Arguments:

sectionNameString

Return type: the empty List ()


moveTo

Move to the named section.

Arguments:

sectionNameString

Return type: the empty List ()


moveUp

Move up to the parent section.

Arguments: none

Return type: the empty List ()


attributeExists

Determine if such an attribute exists in the current section.

Arguments:

attributeNameString

Return type: the Symbol true or the empty List ()


sectionExists

Determine if such a sub-section exists in the current section.

Arguments:

sectionNameString

Return type: the Symbol true or the empty List ()


Contents Index Current topic: objects Related links: built-in objects