interface XRegistryKey in module com::sun::star::registry::

(Global Index)

Syntax

interface XRegistryKey : com::sun::star::uno::XInterface ;

Description

makes structural information (except regarding tree structures) of a single registry key accessible.

This is the main interface for registry keys.

See also

XSimpleRegistry

Method Summary

isReadOnly checks if the key can be overwritten.

isValid checks if the key points to an open valid key in the data-source.

getKeyType

getValueType

getLongValue

setLongValue sets a long value to the key.

getLongListValue

setLongListValue sets a long list value to the key.

getAsciiValue

setAsciiValue sets an ASCII string value to the key.

getAsciiListValue

setAsciiListValue sets an ASCII string list value to the key.

getStringValue

setStringValue sets a unicode string value to the key.

getStringListValue

setStringListValue sets a unicode string value to the key.

getBinaryValue

setBinaryValue sets a binary value to the key.

openKey opens a sub key of the key.

createKey creates a new key in the registry.

closeKey closes a key in the registry.

deleteKey deletes a key from the registry.

openKeys opens all subkeys of the key. If a subkey is a link, the link will be resolved and the appropriate key will be opened.

getKeyNames

createLink creates a new link in the registry.

deleteLink deletes a key from the registry.

getLinkTarget

getResolvedName

Method Details



isReadOnly

Syntax

boolean isReadOnly ();
raises ( com::sun::star::registry::InvalidRegistryException );

Description

checks if the key can be overwritten.

Throws

InvalidRegistryException if the registry is not open.

isValid

Syntax

boolean isValid ();

Description

checks if the key points to an open valid key in the data-source.


getKeyType

Syntax

com::sun::star::registry::RegistryKeyType getKeyType (
string rKeyName )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

Returns

the type of the specified key.

Parameter rKeyName

specifies the relative path from the current key to the key of the type which will be returned.

Throws

InvalidRegistryException if the registry is not open.

getValueType

Syntax

com::sun::star::registry::RegistryValueType getValueType ();
raises ( com::sun::star::registry::InvalidRegistryException );

Description

Returns

the type of the key value or NOT_DEFINED if the key has no value.

Throws

InvalidRegistryException if the registry is not open.

getLongValue

Syntax

long getLongValue ();
raises ( com::sun::star::registry::InvalidRegistryException , com::sun::star::registry::InvalidValueException );

Description

Returns

a long value if the key contains one.

Throws

InvalidRegistryException if the registry is not open.

Throws

InvalidValueException if the value is not of type long.

setLongValue

Syntax

void setLongValue (
long value )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

sets a long value to the key.

If the key already has a value, the value will be overridden.

Throws

InvalidRegistryException if the registry is not open.

getLongListValue

Syntax

sequence< long > getLongListValue ();
raises ( com::sun::star::registry::InvalidRegistryException , com::sun::star::registry::InvalidValueException );

Description

Returns

a sequence of longs if the key contains a long list value.

Throws

InvalidRegistryException if the registry is not open.

Throws

InvalidValueException if the actually value is not of type long list.

setLongListValue

Syntax

void setLongListValue (
sequence< long > seqValue )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

sets a long list value to the key.

If the key already has a value, the value will be overridden.

Throws

InvalidRegistryException if the registry is not open.

getAsciiValue

Syntax

string getAsciiValue ();
raises ( com::sun::star::registry::InvalidRegistryException , com::sun::star::registry::InvalidValueException );

Description

Returns

an ascii string value if the key contains one.

Throws

InvalidRegistryException if the registry is not open.

Throws

InvalidValueException if the actually value is not of type ascii.

setAsciiValue

Syntax

void setAsciiValue (
string value )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

sets an ASCII string value to the key.

The high byte of the string should be NULL. If not, there is no guarantee that the string will be correctly transported. If the key already has a value, the value will be overridden.

Throws

InvalidRegistryException if the registry is not open.

getAsciiListValue

Syntax

sequence< string > getAsciiListValue ();
raises ( com::sun::star::registry::InvalidRegistryException , com::sun::star::registry::InvalidValueException );

Description

Returns

a sequence of ascii strings if the key contains an asci list value.

Throws

InvalidRegistryException if the registry is not open.

Throws

InvalidValueException if the actually value is not of type ascii list.

setAsciiListValue

Syntax

void setAsciiListValue (
sequence< string > seqValue )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

sets an ASCII string list value to the key.

The high byte of the string should be NULL. If not, there is no guarantee that the string will be correctly transported. If the key already has a value, the value will be overridden.

Throws

InvalidRegistryException if the registry is not open.

getStringValue

Syntax

string getStringValue ();
raises ( com::sun::star::registry::InvalidRegistryException , com::sun::star::registry::InvalidValueException );

Description

Returns

a unicode string value if the key contains one.

Throws

InvalidRegistryException if the registry is not open.

Throws

InvalidValueException if the actually value is not of type string.

setStringValue

Syntax

void setStringValue (
string value )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

sets a unicode string value to the key.

If the key already has a value, the value will be overridden.

Throws

InvalidRegistryException if the registry is not open.

getStringListValue

Syntax

sequence< string > getStringListValue ();
raises ( com::sun::star::registry::InvalidRegistryException , com::sun::star::registry::InvalidValueException );

Description

Returns

a sequence of unicode strings if the key contains an unicode string list value.

Throws

InvalidRegistryException if the registry is not open.

Throws

InvalidValueException if the actually value is not of type string list.

setStringListValue

Syntax

void setStringListValue (
sequence< string > seqValue )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

sets a unicode string value to the key.

If the key already has a value, the value will be overridden.

Throws

InvalidRegistryException if the registry is not open.

getBinaryValue

Syntax

sequence< byte > getBinaryValue ();
raises ( com::sun::star::registry::InvalidRegistryException , com::sun::star::registry::InvalidValueException );

Description

Returns

a binary value if the key contains one.

Throws

InvalidRegistryException if the registry is not open.

Throws

InvalidValueException if the actually value is not of type binary.

setBinaryValue

Syntax

void setBinaryValue (
sequence< byte > value )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

sets a binary value to the key.

If the key already has a value, the value will be overridden.

Throws

InvalidRegistryException if the registry is not open.

openKey

Syntax

com::sun::star::registry::XRegistryKey openKey (
string aKeyName )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

opens a sub key of the key.

If the sub key does not exist, the function returns a NULL-interface.

Parameter aKeyName

the relative path from the current key to the key which will be created.

Returns

a NULL interface if the key does not exist.

Throws

InvalidRegistryException if the registry is not open.

createKey

Syntax

com::sun::star::registry::XRegistryKey createKey (
string aKeyName )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

creates a new key in the registry.

If the key already exists, the function will open the key.

Parameter aKeyName

specifies the relative path from the current key to the key which will be created.

Returns

a NULL interface if the key could not be created.

Throws

InvalidRegistryException if the registry is not open, the registry is reaonly or if the key exists and is of type LINK.

closeKey

Syntax

void closeKey ();
raises ( com::sun::star::registry::InvalidRegistryException );

Description

closes a key in the registry.

Throws

InvalidRegistryException if the registry is not open.

deleteKey

Syntax

void deleteKey (
string rKeyName )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

deletes a key from the registry.

Parameter aKeyName

specifies the relative path from the current key to the key which will be deleted.

Throws

InvalidRegistryException if the registry is not open, the registry is readonly, the key does not exists or if the key is of type LINK.

openKeys

Syntax

sequence< com::sun::star::registry::XRegistryKey > openKeys ();
raises ( com::sun::star::registry::InvalidRegistryException );

Description

opens all subkeys of the key. If a subkey is a link, the link will be resolved and the appropriate key will be opened.

Returns

an empty sequnece if the key has no subkeys.

Throws

InvalidRegistryException if the registry is not open.

getKeyNames

Syntax

sequence< string > getKeyNames ();
raises ( com::sun::star::registry::InvalidRegistryException );

Description

Returns

a sequence with the names of all subkeys of the key. If the key has no subkeys, the function returns an empty sequence. If a subkey is a link, the name of the link will be returned.

Throws

InvalidRegistryException if the registry is not open.

createLink

Syntax

boolean createLink (
string aLinkName,
string aLinkTarget )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

creates a new link in the registry.

Returns

true> if the link was created. If the link already exists or the link target does not exist, the function returns false .

Parameter aLinkName

specifies the relative path from the current key to the link which will be created.

Parameter aLinkTarget

specifies the full path of the key which will be referenced by the link.

Throws

InvalidRegistryException if the registry is not open or the registry is reaonly.

deleteLink

Syntax

void deleteLink (
string rLinkName )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

deletes a key from the registry.

Parameter aLinkName

specifies the relative path from the current key to the link which will be deleted.

Throws

InvalidRegistryException if the registry is not open, the registry is readonly, or if the link does not exist.

getLinkTarget

Syntax

string getLinkTarget (
string rLinkName )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

Returns

the target of the link specified by rLinkName.

Parameter rLinKName

specifies the relative path from the current key to the link which target will be returned.

Throws

InvalidRegistryException if the registry is not open or the link does not exists.

getResolvedName

Syntax

string getResolvedName (
string aKeyName )
raises ( com::sun::star::registry::InvalidRegistryException );

Description

Returns

the resolved name of a key. The function resolve the complete name of the key. If a link could not resolved the linktarget concatenate with the unresolved rest of the name will returned.

Parameter rKeyName

specifies a relative path from the current key which will be resolved from all links.

Throws

InvalidRegistryException if the registry is not open or a recursion was detected.
Top of Page