»
Symbian OS v9.2 »
Symbian OS reference »
C++ component reference »
Syslibs CENTRALREPOSITORY »
CRepository
Location:
centralrepository.h
Link against: centralrepository.lib
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
CBase - Base class for all classes to be instantiated on the heapCRepository - Provides access to a repository
Members
Defined in CRepository:
Delete(), FindEqL(), FindEqL(), FindEqL(), FindEqL(), FindL(), FindNeqL(), FindNeqL(), FindNeqL(), FindNeqL(), Get(), Get(), Get(), Get(), Get(), Get(), Move(), NewL(), NewLC(), NotifyCancel(), NotifyCancel(), NotifyCancelAll(), NotifyRequest(), NotifyRequest(), ~CRepository()
Inherited from CBase:
Extension_(),
operator new()
Construction and destruction
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 |
|
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 |
|
virtual IMPORT_C ~CRepository();
Description
Destructor.
IMPORT_C TInt Delete(TUint32 aPartialKey, TUint32 aMask, TUint32 &aErrorKey);
Description
Deletes all the settings that exist and match the specification: (key & mask) == (partialKey & mask) Partial key is guaranteed to be masked before use. Examples of use:
-
To delete a single key. Delete(key, 0xFFFFFFFF, errorKey);
-
To delete all keys from 0 to 0xFF: Delete(0, 0xFFFFFF00, errorKey); (digits from 0 to 0xFF would be ignored if given in the partial key)
-
To delete all keys matching 0x5B??3A?6: Delete(0x5B003A06, 0xFF00FF0F, errorKey);
Parameters
Return value
| 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. |
|
| 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. |
|
| 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. |
|
| 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. |
|
| 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. |
|
| 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. |
|
IMPORT_C TInt Move(TUint32 aSourcePartialKey, TUint32 aTargetPartialKey, TUint32 aMask, TUint32 &aErrorKey);
Description
Moves all the settings that exist and match the specification: (oldkey & mask) == (sourcePartialKey & mask) to new locations where (newkey & mask) == (targetPartialKey & mask). For those keys that match the source specification, those bits in the key for which the corresponding mask bit is zero remain unchanged. All remaining bits change from (sourcePartialKey & mask) to (targetPartialKey & mask). Both partial keys are guaranteed to be masked before use. Examples of use:
-
To move a single key from oldKey to newKey. Move(oldKey, newKey, 0xFFFFFFFF, errorKey);
-
To move all keys from 0 to 0xFF to be from 0x100 to 0x1FF: Move(0, 0x100, 0xFFFFFF00, errorKey); (digits from 0 to 0xFF would be ignored if given in the partial keys)
-
To move all keys matching 0x5B??3A?6 to 0xDC??44?F: Move(0x5B003A06, 0xDC00440F, 0xFF00FF0F, errorKey);
Parameters
Return value
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. |
|
| 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 |
|
TUint32 aMask |
|
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:
| 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 |
|
TUint32 aMask |
|
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:
| 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 |
|
TUint32 aMask |
|
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:
IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, const TDesC16 &aValue, RArray< TUint32 > &aFoundKeys);
Description
Parameters
Return value
| 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 |
|
TUint32 aMask |
|
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:
| 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 |
|
TUint32 aMask |
|
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:
| 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 |
|
TUint32 aMask |
|
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:
IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, const TDesC16 &aValue, RArray< TUint32 > &aFoundKeys);
Description
Parameters
Return value
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. |
|
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
Return value
TInt
|
KErrNone if successful, KErrAlreadyExists if there is already a notification from this CRepository on this setting, or an error from IPC. |
|
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. |
|
IMPORT_C TInt NotifyCancel(TUint32 aPartialKey, TUint32 aMask);
Description
Cancels a notification previously requested from the three-argument overload of NotifyRequest.
Parameters
Return value
TInt
|
KErrNone The method always returns KErrNone. |
|
IMPORT_C TInt NotifyCancelAll();
Description
Cancels all uncompleted notifications from this CRepository.
Return value
TInt
|
KErrNone The method always returns KErrNone. |
|