Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <centralrepository.h>
Link against: centralrepository.lib

Class CRepository

class CRepository : public CBase;

Description

Provides access to a repository.

There are potentially 2^32 repositories, each identified by a UID. Within each repository up to 2^32 settings can be stored. Settings within a repository are identified by a 32-bit key and may be of the types integer, real or descriptor.

Derivation

Members

Defined in CRepository:

Inherited from CBase:

Related Topics


Construction and destruction


NewL(TUid)

Capability: Illegal

IMPORT_C static CRepository* NewL(TUid aRepositoryUid);

Description

Creates a CRepository object for accessing a repository. If there is no such repository, the function leaves with KErrNotFound.

Parameters

TUid aRepositoryUid

The UID of the repository to be accessed

Return value

CRepository *

A pointer to a newly created CRepository object


NewLC(TUid)

Capability: Illegal

IMPORT_C static CRepository* NewLC(TUid aRepositoryUid);

Description

Creates a CRepository object for accessing a repository. If there is no such repository, the function leaves with KErrNotFound. A pointer to the object is left on the cleanup stack.

Parameters

TUid aRepositoryUid

The UID of the repository to be accessed

Return value

CRepository *

A pointer to a newly created CRepository object


~CRepository()

Capability: Illegal

IMPORT_C virtual ~CRepository();

Description

Destructor.

[Top]


Member functions


Get(TUint32,TInt &)

Capability: Dependent Caller must satisfy the read access policy of that key in the repository.

IMPORT_C TInt Get(TUint32 aKey, TInt &aValue);

Description

Reads an integer setting.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aKey

Key of setting to be read.

TInt &aValue

Returns the value of the setting if it is an integer.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if the setting does not exist, KErrArgument if the setting exists but is not an integer, plus other system-wide error codes.


Get(TUint32,TReal &)

Capability: Dependent Caller must satisfy the read access policy of that key in the repository.

IMPORT_C TInt Get(TUint32 aKey, TReal &aValue);

Description

Reads a floating point setting.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aKey

Key of setting to be read.

TReal &aValue

Returns the value of the setting if it is a floating point value.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if the setting does not exist, KErrArgument if the setting exists but is not a floating point value, plus other system-wide error codes.


Get(TUint32,TDes8 &)

Capability: Dependent Caller must satisfy the read access policy of that key in the repository.

IMPORT_C TInt Get(TUint32 aKey, TDes8 &aValue);

Description

Reads a descriptor setting.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aKey

Key of setting to be read.

TDes8 &aValue

Returns the value of the setting if it is a descriptor.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if the setting does not exist, KErrArgument if the setting exists but is not a descriptor, KErrOverflow if the descriptor is too small to receive the value in the repository, plus other system-wide error codes.


Get(TUint32,TDes8 &,TInt &)

Capability: Dependent Caller must satisfy the read access policy of that key in the repository.

IMPORT_C TInt Get(TUint32 aId, TDes8 &aValue, TInt &aActualLength);

Description

Reads a descriptor setting.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aId

Key of setting to be read.

TDes8 &aValue

Returns the value of the setting if it is a descriptor.

TInt &aActualLength

Returns the actual length of the setting if it is a descriptor.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if the setting does not exist, KErrArgument if the setting exists but is not a descriptor, KErrOverflow if the descriptor is too small to receive the value in the repository, plus other system-wide error codes.

Panic codes

Panics

client if called while pending start or pending commit transaction.


Get(TUint32,TDes16 &)

Capability: Dependent Caller must satisfy the read access policy of that key in the repository.

IMPORT_C TInt Get(TUint32 aKey, TDes16 &aValue);

Description

Reads a descriptor setting.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aKey

Key of setting to be read.

TDes16 &aValue

Returns the value of the setting if it is a descriptor.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if the setting does not exist, KErrArgument if the setting exists but is not a descriptor, KErrOverflow if the descriptor is too small to receive the value in the repository, plus other system-wide error codes.


Get(TUint32,TDes16 &,TInt &)

Capability: Dependent Caller must satisfy the read access policy of that key in the repository.

IMPORT_C TInt Get(TUint32 aId, TDes16 &aValue, TInt &aActualLength);

Description

Reads a descriptor setting.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aId

Key of setting to be read.

TDes16 &aValue

Returns the value of the setting if it is a descriptor.

TInt &aActualLength

Returns the actual length of the setting if it is a descriptor.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if the setting does not exist, KErrArgument if the setting exists but is not a descriptor, KErrOverflow if the descriptor is too small to receive the value in the repository, plus other system-wide error codes.

Panic codes

Panics

client if called while pending start or pending commit transaction.


FindL(TUint32,TUint32,RArray< TUint32 > &)

IMPORT_C TInt FindL(TUint32 aPartialKey, TUint32 aMask, RArray< TUint32 > &aFoundKeys);

Description

Finds all the settings that exist and match the specification given by aPartialKey and aMask. Matches occur whenever (key & mask) == (partialKey & mask). The partial key is guaranteed to be masked before use.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aPartialKey

Contains a bit pattern that all the keys returned must at least partially match.

TUint32 aMask

Has bits set for all the bits in aPartialKey that must match the returned keys.

RArray< TUint32 > &aFoundKeys

All the keys found.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrNotFound if no items were found in the source range, plus other system-wide error codes.


FindEqL(TUint32,TUint32,TInt,RArray< TUint32 > &)

Capability: Dependent Caller must satisfy the read policies of all settings found in the source range.

IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, TInt aValue, RArray< TUint32 > &aFoundKeys);

Description

Finds all the settings that contain a given integer and match the specification given by aPartialKey and aMask.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aPartialKey

Contains a bit pattern that all the keys returned must at least partially match.

TUint32 aMask

Has bits set for all the bits in aPartialKey that must match the returned keys.

TInt aValue

Settings for the keys found will be integers with value aValue.

RArray< TUint32 > &aFoundKeys

All the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is an integer aValue.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if capability check passed but no matching items are found, plus other system-wide error codes.

See also:


FindEqL(TUint32,TUint32,const TReal &,RArray< TUint32 > &)

Capability: Dependent Caller must satisfy the read policies of all settings found in the source range.

IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, const TReal &aValue, RArray< TUint32 > &aFoundKeys);

Description

Finds all the settings that contain a given floating point value and match the specification given by aPartialKey and aMask.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aPartialKey

Contains a bit pattern that all the keys returned must at least partially match.

TUint32 aMask

Has bits set for all the bits in aPartialKey that must match the returned keys.

const TReal &aValue

Settings for the keys found will be floating point values with value aValue.

RArray< TUint32 > &aFoundKeys

All the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is a floating point value aValue.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if capability check passed but no matching items are found, plus other system-wide error codes.

See also:


FindEqL(TUint32,TUint32,const TDesC8 &,RArray< TUint32 > &)

Capability: Dependent Caller must satisfy the read policies of all settings found in the source range.

IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, const TDesC8 &aValue, RArray< TUint32 > &aFoundKeys);

Description

Finds all the settings that contain a given string value and match the specification given by aPartialKey and aMask.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aPartialKey

Contains a bit pattern that all the keys returned must at least partially match.

TUint32 aMask

Has bits set for all the bits in aPartialKey that must match the returned keys.

const TDesC8 &aValue

Settings for the keys found will be string values with value aValue.

RArray< TUint32 > &aFoundKeys

All the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is a string value aValue.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if capability check passed but no matching items are found, plus other system-wide error codes.

See also:


FindEqL(TUint32,TUint32,const TDesC16 &,RArray< TUint32 > &)

Capability: Dependent Caller must satisfy the read policies of all settings found in the source range.

IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, const TDesC16 &aValue, RArray< TUint32 > &aFoundKeys);

Description

Finds all the settings that contain a given string value and match the specification given by aPartialKey and aMask.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aPartialKey

Contains a bit pattern that all the keys returned must at least partially match.

TUint32 aMask

Has bits set for all the bits in aPartialKey that must match the returned keys.

const TDesC16 &aValue

Settings for the keys found will be string values with value aValue.

RArray< TUint32 > &aFoundKeys

All the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is a string value aValue.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if capability check passed but no matching items are found, plus other system-wide error codes.

See also:


FindNeqL(TUint32,TUint32,TInt,RArray< TUint32 > &)

Capability: Dependent Caller must satisfy the read policies of all settings found in the source range.

IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, TInt aValue, RArray< TUint32 > &aFoundKeys);

Description

Finds all the settings that match the specification given by aPartialKey and aMask, but are either not integer values or do not have the given value.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aPartialKey

Contains a bit pattern that all the keys returned must at least partially match.

TUint32 aMask

Has bits set for all the bits in aPartialKey that must match the returned keys.

TInt aValue

Settings for the keys found will be settings that either contain values that are not integers or integers other than aValue.

RArray< TUint32 > &aFoundKeys

All the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is either not an integer or an integer not equal to aValue.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if capability check passed but no non-matching items are found, plus other system-wide error codes.

See also:


FindNeqL(TUint32,TUint32,const TReal &,RArray< TUint32 > &)

Capability: Dependent Caller must satisfy the read policies of all settings found in the source range.

IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, const TReal &aValue, RArray< TUint32 > &aFoundKeys);

Description

Finds all the settings that match the specification given by aPartialKey and aMask, but are either not floating point values or do not have the given value.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aPartialKey

Contains a bit pattern that all the keys returned must at least partially match.

TUint32 aMask

Has bits set for all the bits in aPartialKey that must match the returned keys.

const TReal &aValue

Settings for the keys found will be settings that either contain values that are not floating point or floating point values other than aValue.

RArray< TUint32 > &aFoundKeys

All the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is either not a floating point value or a floating point value not equal to aValue.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if capability check passed but no non-matching items are found, plus other system-wide error codes.

See also:


FindNeqL(TUint32,TUint32,const TDesC8 &,RArray< TUint32 > &)

Capability: Dependent Caller must satisfy the read policies of all settings found in the source range.

IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, const TDesC8 &aValue, RArray< TUint32 > &aFoundKeys);

Description

Finds all the settings that match the specification given by aPartialKey and aMask, but are either not string values or do not match the given string.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aPartialKey

Contains a bit pattern that all the keys returned must at least partially match.

TUint32 aMask

Has bits set for all the bits in aPartialKey that must match the returned keys.

const TDesC8 &aValue

Settings for the keys found will be settings that either contain values that are not strings or strings with value other than aValue.

RArray< TUint32 > &aFoundKeys

All the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is either not a string value or a string value not equal to aValue.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if capability check passed but no non-matching items are found, plus other system-wide error codes.

See also:


FindNeqL(TUint32,TUint32,const TDesC16 &,RArray< TUint32 > &)

Capability: Dependent Caller must satisfy the read policies of all settings found in the source range.

IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, const TDesC16 &aValue, RArray< TUint32 > &aFoundKeys);

Description

Finds all the settings that match the specification given by aPartialKey and aMask, but are either not string values or do not match the given string.

Post-Condition

Transactions fail only on those "other system-wide error codes".

Parameters

TUint32 aPartialKey

Contains a bit pattern that all the keys returned must at least partially match.

TUint32 aMask

Has bits set for all the bits in aPartialKey that must match the returned keys.

const TDesC16 &aValue

Settings for the keys found will be settings that either contain values that are not strings or strings with value other than aValue.

RArray< TUint32 > &aFoundKeys

All the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is either not a string value or a string value not equal to aValue.

Return value

TInt

KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrNotFound if capability check passed but no non-matching items are found, plus other system-wide error codes.

See also:


NotifyRequest(TUint32,TRequestStatus &)

Capability: Security policy note: The caller must satisfy the relevant access policies for the repository

IMPORT_C TInt NotifyRequest(TUint32 aKey, TRequestStatus &aStatus);

Description

Requests a notification if the value of a given setting changes. Only one notification can be received per call to NotifyRequest. Only one notification per setting per CRepository may be active at any one time.

Parameters

TUint32 aKey

The key setting to be informed about.

TRequestStatus &aStatus

The object that will receive the notification.

Return value

TInt

KErrNone if successful, KErrAlreadyExists if there is already a notification from this CRepository on this setting, or an error from IPC or server side resource allocation failure.


NotifyRequest(TUint32,TUint32,TRequestStatus &)

Capability: Security policy note: The caller must satisfy the relevant access policies for the repository

IMPORT_C TInt NotifyRequest(TUint32 aPartialKey, TUint32 aMask, TRequestStatus &aStatus);

Description

Requests a notification if the value of a given setting changes. Only one notification can be received per call to NotifyRequest. Only one notification per setting per CRepository may be active at any one time.

Parameters

TUint32 aPartialKey

The partial key setting to be informed about.

TUint32 aMask

The mask to be used with the partial key

TRequestStatus &aStatus

The object that will receive the notification.

Return value

TInt

KErrNone if successful, KErrAlreadyExists if there is already a notification from this CRepository on this setting, or an error from IPC.


NotifyCancel(TUint32)

Capability: Illegal

IMPORT_C TInt NotifyCancel(TUint32 aKey);

Description

Cancels a notification previously requested from the two-argument overload of NotifyRequest.

Parameters

TUint32 aKey

The parameter to the previous call to NotifyRequest to be cancelled.

Return value

TInt

KErrNone The method always returns KErrNone.


NotifyCancel(TUint32,TUint32)

Capability: Illegal

IMPORT_C TInt NotifyCancel(TUint32 aPartialKey, TUint32 aMask);

Description

Cancels a notification previously requested from the three-argument overload of NotifyRequest.

Parameters

TUint32 aPartialKey

The parameter to the previous call to NotifyRequest to be cancelled.

TUint32 aMask

The mask to be used with the partial key

Return value

TInt

KErrNone The method always returns KErrNone.


NotifyCancelAll()

Capability: Illegal

IMPORT_C TInt NotifyCancelAll();

Description

Cancels all uncompleted notifications from this CRepository.

Return value

TInt

KErrNone The method always returns KErrNone.