Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: 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:
FindEqL(), FindEqL(), FindEqL(), FindEqL(), FindL(), FindNeqL(), FindNeqL(), FindNeqL(), FindNeqL(), Get(), Get(), Get(), Get(), Get(), Get(), NewL(), NewLC(), NotifyCancel(), NotifyCancel(), NotifyCancelAll(), NotifyRequest(), NotifyRequest(), ~CRepository()

Inherited from CBase:
Delete(), Extension_(), operator new()

See also


Construction and destruction


NewL()

Capability: Illegal

static IMPORT_C 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()

Capability: Illegal

static IMPORT_C 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

virtual IMPORT_C ~CRepository();

Description

Destructor.

[Top]


Member functions


Get()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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.