|
pragma elaborate_body;
|
Exceptions
|
Type Summary
keyTable |
r_key derived from Unbounded_String |
New Operations: |
Delete_Key ,
Get ,
Get ,
Put ,
Put ,
To_Key
|
Inherited Operations: |
"&" ,
"&" ,
"&" ,
"&" ,
"&" ,
"*" ,
"*" ,
"*" ,
"<" ,
"<" ,
"<" ,
"<=" ,
"<=" ,
"<=" ,
"=" ,
"=" ,
"=" ,
">" ,
">" ,
">" ,
">=" ,
">=" ,
">=" ,
Append ,
Append ,
Append ,
Count ,
Count ,
Count ,
Delete ,
Delete ,
Element ,
Find_Token ,
Head ,
Head ,
Index ,
Index ,
Index ,
Index_Non_Blank ,
Insert ,
Insert ,
Length ,
Overwrite ,
Overwrite ,
Replace_Element ,
Replace_Slice ,
Replace_Slice ,
Slice ,
Tail ,
Tail ,
To_String ,
To_Unbounded_String ,
To_Unbounded_String ,
Translate ,
Translate ,
Translate ,
Translate ,
Trim ,
Trim ,
Trim ,
Trim
|
r_section derived from Unbounded_String |
New Operations: |
Delete_Section ,
Set_Section ,
To_Section
|
Inherited Operations: |
"&" ,
"&" ,
"&" ,
"&" ,
"&" ,
"*" ,
"*" ,
"*" ,
"<" ,
"<" ,
"<" ,
"<=" ,
"<=" ,
"<=" ,
"=" ,
"=" ,
"=" ,
">" ,
">" ,
">" ,
">=" ,
">=" ,
">=" ,
Append ,
Append ,
Append ,
Count ,
Count ,
Count ,
Delete ,
Delete ,
Element ,
Find_Token ,
Head ,
Head ,
Index ,
Index ,
Index ,
Index_Non_Blank ,
Insert ,
Insert ,
Length ,
Overwrite ,
Overwrite ,
Replace_Element ,
Replace_Slice ,
Replace_Slice ,
Slice ,
Tail ,
Tail ,
To_String ,
To_Unbounded_String ,
To_Unbounded_String ,
Translate ,
Translate ,
Translate ,
Translate ,
Trim ,
Trim ,
Trim ,
Trim
|
registry_type (abstract type) |
Primitive Operations: |
Close ,
Create ,
Delete_Key ,
Delete_Section ,
Get ,
Get ,
Get_Keys ,
Get_Sections ,
Is_Open ,
Open ,
Put ,
Put ,
Set_Section
|
registry_type_Access |
sectionTable |
sys_access |
|
Constants and Named Numbers
|
Other Items:
|
type sys_access is (CLASS_USER,CLASS_SYSTEM);
|
Type of the access. CLASS_USER accesses the
user information, CLASS_SYSTEM the system
wide configuration information
|
|
type r_key is new Unbounded_String;
|
Type for the key name
|
|
type r_section is new Unbounded_String;
|
Type for the section name
|
|
type registry_type is abstract tagged private;
|
Abstract record which stores the internal
data for a registry.
|
|
|
|
type keyTable is array(Integer range<>) of r_key;
|
Type for returning keys
|
|
function To_Key(key : String) return r_key;
|
Convert a String to a key value
key : String String with key name
Returns : r_key Key as type r_key
|
|
function To_Section(section : String) return r_section;
|
Convert a String with a secton name to type r_section
section : String String with section name
Returns : r_Section Section as type r_section
|
|
function Create(programm_name : String;s_access :sys_access) return registry_type is abstract;
|
Create a registry for programm_name with selected access.
programm_name : String Name of the programm or more general
the name of the config file on Unix or registry key under
PROGRAMM/ on Windows
s_access : sys_access If CLASS_USER the information is
stored so that the normal user can access them. CLASS_SYSTEM
indicates system wide access. The user can only read but not
write this information. Only the administrator can read and
write to this.
For opening a registry better use the Create function from
the package registry.factory . This function returns a
correct initialized instance of one of the subtypes of
registry-file or registry-win .
|
|
procedure Set_Section(reg : in out registry_type; s : in r_section) is abstract;
|
Set a setion in the registry. If the section does not exists
the section is created.
reg : registry_type a with Create initialized handle of
the registry.
s : r_section A section name.
|
|
procedure Put(reg : in out registry_type;
key : in r_key;
val : in String
) is abstract;
|
Store a key/value pair in the registry. If the key
does not exists in the section, the key is created,
otherwise the old value of the key is overwritten.
The value is from type String.
reg : registry_type a with Create initialized handle of
the registry
key : r_key The key name.
val : String The string value for the key.
|
|
procedure Put(reg : in out registry_type;
key : in r_key;
val : in Integer
) is abstract;
|
Store a key/value pair in the registry. If the key
does not exists in the section, the key is created,
otherwise the old value of the key is overwritten.
The value is from type Integer.
reg : registry_type a with Create initialized handle of
the registry
key : r_key The key name.
val : Integer The integer value for the key.
|
|
procedure Get(reg : in out registry_type;
key : in r_key;
val : out Unbounded_String
) is abstract;
|
Get a value from a key. In case that the key does
not exists the exception REGISTRY_NO_KEY is raised;
reg : registry_type a with Create initialized handle of
the registry.
key : r_key The key name.
val : Unbounded_String Returns the value from the key.
|
|
procedure Get(reg : in out registry_type;
key : in r_key;
val : out Integer
) is abstract;
|
Get a value from a key. In case that the key does
not exists the exception REGISTRY_NO_KEY is raised;
reg : registry_type a with Create initialized handle of
the registry.
key : r_key The key name.
val :Integer Returns the value from the key.
|
|
function Get_Sections(reg : in registry_type)
return sectionTable is abstract;
|
Get all known sections.
reg : registry_type a with Create initialized handle of
the registry.
Returns : secionTable An array of r_section with all sections of this
registry.
|
|
function Get_Keys(reg : in registry_type)
return keyTable is abstract;
|
Get all known keys for the current section. If there is no key, raise
REGISTRY_NO_KEY exception.
reg : registry_type a with Create initialized handle of
the registry.
Returns : keyTable An array of r_key with all keys of a section, set
with Set_Section .
|
|
procedure Open(reg : in out registry_type) is abstract;
|
Open access to the registry
reg : registry_type a with Create initialized handle of
the registry.
|
|
procedure Close(reg: in out registry_type) is abstract;
|
Close access to the registry and write back all changes.
reg : registry_type a with Create initialized handle of
the registry.
|
|
function Is_Open(reg : in registry_type) return Boolean is abstract;
|
Check if the registry is opened;
reg : registry_type a with Create initialized handle of
the registry.
Returns : boolean true if the registry is open.
|
|
procedure Delete_Key(reg : in out registry_type; key : in r_key) is abstract;
|
Delete a key from the current section. In case that the key does
not exists the exception REGISTRY_NO_KEY is raised.
reg : registry_type a with Create initialized handle of
the registry.
key : r_key The key name to delete.
|
|
procedure Delete_Section(reg : in out registry_type; sec : in r_section) is abstract;
|
Delete a complete section including all keys. The current section
is set back to the empty default section. So after this command
you must restore your previous default section via the
Set_Section function. In case that the section does
not exists the exception REGISTRY_NO_SECTION is raised.
Also in case that subsections exists the exception
REGISTRY_SUBSECTION_EXISTS is raised.
reg : registry_type a with Create initialized handle of
the registry.
sec : r_section The section name to delete.
|
|
function Get_ErrorMessage(reg : in registry_type'Class) return String;
|
In case of an exception, Get_ErrorMessage returns a verbose error message
reg : registry_type handle of the registry which caused this
exception.
Returns : String Error message string.
|
|
function Get_ErrorMessage(reg : in registry_type'Class) return Unbounded_String;
|
In case of an exception, Get_ErrorMessage returns a verbose error message
reg : registry_type handle of the registry which caused this
exception.
Returns : Unbounded_String Error message string.
|
|
|
private
|
|