#include <centralrepository.h>
class CRepository : public CBase |
Public Member Type Definitions | |
---|---|
typedef | TPckgBuf< TUint32 > TTransactionKeyInfoBuf |
Public Member Enumerations | |
---|---|
enum | TTransactionMode { EConcurrentReadWriteTransaction, EReadTransaction, EReadWriteTransaction } |
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.
Buffer type for aKeyInfo parameter to asynchronous CommitTransaction.
See also: CRepository::CommitTransaction(TDes8& aKeyInfo, TRequestStatus& aStatus)
Transaction mode chosen with StartTransaction.
IMPORT_C void | CancelTransaction | ( | ) |
IMPORT_C void | CleanupCancelTransactionPushL | ( | ) |
IMPORT_C void | CleanupFailTransactionPushL | ( | ) |
void | CleanupRollbackTransactionPushL | ( | ) | [inline] |
Same as CleanupCancelTransactionPushL.
See also: CleanupCancelTransactionPushL
Parameter | Description |
---|---|
aKeyInfo | On success: returns the number of keys whose values were modified. On failure: returns the key or partial key involved in the first error, or KUnspecifiedKey if failure could not be attributed to any key. |
Returns: KErrNone on success, or error code giving first reason for failing. If KErrLocked is returned for EConcurrentReadWriteTransaction, transaction was interrupted by another client committing changes and should be repeated.
IMPORT_C void | CommitTransaction | ( | TDes8 & | aKeyInfo, |
TRequestStatus & | aStatus | |||
) |
Commits a transaction asynchronously to allow client to avoid being blocked during the persist operation and other server activity. A successful return guarantees the consistency and persistence of all values read and written during the transaction. Use CancelTransaction to cancel asynchronous request.
See also: CRepository::TTransactionKeyInfoBuf
Parameter | Description |
---|---|
aKeyInfo | A descriptor to receive a TUint32 value, e.g. TTransactionKeyInfoBuf, which client must ensure remains in scope for the duration of the asynchronous request. On success: returns the number of keys whose values were modified. On failure: returns the key or partial key involved in the first error, or KUnspecifiedKey if failure could not be attributed to any key. |
aStatus | Completion status of asynchronous request: On success (if not cancelled): KErrNone; On failure: error code giving first reason for failing. If KErrLocked is returned for EConcurrentReadWriteTransaction, transaction was interrupted by another client committing changes and should be repeated. |
Parameter | Description |
---|---|
aKey | New setting key. |
aValue | Setting value. |
Returns: KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrAlreadyExists if a setting with that key already exists plus other system-wide error codes.
Parameter | Description |
---|---|
aKey | New setting key. |
aValue | Setting value. |
Returns: KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrAlreadyExists if a setting with that key already exists plus other system-wide error codes.
Parameter | Description |
---|---|
aKey | New setting key. |
aValue | Setting value. |
Returns: KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrAlreadyExists if a setting with that key already exists KErrArgument if the descriptor is longer than KMaxBinaryLength, plus other system-wide error codes.
Parameter | Description |
---|---|
aKey | New setting key. |
aValue | Setting value. |
Returns: KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrAlreadyExists if a setting with that key already exists KErrArgument if the descriptor is longer than KMaxUnicodeStringLength, plus other system-wide error codes.
Parameter | Description |
---|---|
aKey | Key of setting to be deleted. |
Returns: 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, plus other system-wide error codes.
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);
Parameter | Description |
---|---|
aPartialKey | Contains a bit pattern that all the keys must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the keys being deleted. |
aErrorKey | If the delete operation fails this contains the key involved in the failure, or aPartialKey or KUnspecifiedKey if it could not be attributed to any key |
Returns: KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrNotFound if no items were found in the partial key range. KErrPermissionDenied if caller fails capability check. plus other system-wide error codes.
IMPORT_C void | FailTransaction | ( | ) |
Finds all the settings that contain a given integer and match the specification given by aPartialKey and aMask.
See also: FindL()
Parameter | Description |
---|---|
aPartialKey | Contains a bit pattern that all the keys returned must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the returned keys. |
aValue | Settings for the keys found will be integers with value aValue. |
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. |
Returns: 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.
IMPORT_C TInt | FindEqL | ( | TUint32 | aPartialKey, |
TUint32 | aMask, | |||
const TReal & | aValue, | |||
RArray< TUint32 > & | aFoundKeys | |||
) |
Finds all the settings that contain a given floating point value and match the specification given by aPartialKey and aMask.
See also: FindL()
Parameter | Description |
---|---|
aPartialKey | Contains a bit pattern that all the keys returned must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the returned keys. |
aValue | Settings for the keys found will be floating point values with value aValue. |
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. |
Returns: 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.
IMPORT_C TInt | FindEqL | ( | TUint32 | aPartialKey, |
TUint32 | aMask, | |||
const TDesC8 & | aValue, | |||
RArray< TUint32 > & | aFoundKeys | |||
) |
Finds all the settings that contain a given string value and match the specification given by aPartialKey and aMask.
See also: FindL()
Parameter | Description |
---|---|
aPartialKey | Contains a bit pattern that all the keys returned must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the returned keys. |
aValue | Settings for the keys found will be string values with value aValue. |
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. |
Returns: 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.
IMPORT_C TInt | FindEqL | ( | TUint32 | aPartialKey, |
TUint32 | aMask, | |||
const TDesC16 & | aValue, | |||
RArray< TUint32 > & | aFoundKeys | |||
) |
Finds all the settings that contain a given string value and match the specification given by aPartialKey and aMask.
See also: FindL()
Parameter | Description |
---|---|
aPartialKey | Contains a bit pattern that all the keys returned must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the returned keys. |
aValue | Settings for the keys found will be string values with value aValue. |
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. |
Returns: 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.
Parameter | Description |
---|---|
aPartialKey | Contains a bit pattern that all the keys returned must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the returned keys. |
aFoundKeys | All the keys found. |
Returns: 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.
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.
See also: FindL()
Parameter | Description |
---|---|
aPartialKey | Contains a bit pattern that all the keys returned must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the returned keys. |
aValue | Settings for the keys found will be settings that either contain values that are not integers or integers other than aValue. |
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. |
Returns: 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.
IMPORT_C TInt | FindNeqL | ( | TUint32 | aPartialKey, |
TUint32 | aMask, | |||
const TReal & | aValue, | |||
RArray< TUint32 > & | aFoundKeys | |||
) |
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.
See also: FindL()
Parameter | Description |
---|---|
aPartialKey | Contains a bit pattern that all the keys returned must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the returned keys. |
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. |
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. |
Returns: 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.
IMPORT_C TInt | FindNeqL | ( | TUint32 | aPartialKey, |
TUint32 | aMask, | |||
const TDesC8 & | aValue, | |||
RArray< TUint32 > & | aFoundKeys | |||
) |
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.
See also: FindL()
Parameter | Description |
---|---|
aPartialKey | Contains a bit pattern that all the keys returned must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the returned keys. |
aValue | Settings for the keys found will be settings that either contain values that are not strings or strings with value other than aValue. |
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. |
Returns: 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.
IMPORT_C TInt | FindNeqL | ( | TUint32 | aPartialKey, |
TUint32 | aMask, | |||
const TDesC16 & | aValue, | |||
RArray< TUint32 > & | aFoundKeys | |||
) |
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.
See also: FindL()
Parameter | Description |
---|---|
aPartialKey | Contains a bit pattern that all the keys returned must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the returned keys. |
aValue | Settings for the keys found will be settings that either contain values that are not strings or strings with value other than aValue. |
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. |
Returns: 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.
Parameter | Description |
---|---|
aKey | Key of setting to be read. |
aValue | Returns the value of the setting if it is an integer. |
Returns: 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.
Parameter | Description |
---|---|
aKey | Key of setting to be read. |
aValue | Returns the value of the setting if it is a floating point value. |
Returns: 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.
Parameter | Description |
---|---|
aKey | Key of setting to be read. |
aValue | Returns the value of the setting if it is a descriptor. |
Returns: 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.
Parameter | Description |
---|---|
aId | Key of setting to be read. |
aValue | Returns the value of the setting if it is a descriptor. |
aActualLength | Returns the actual length of the setting if it is a descriptor. |
Returns: 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.
Parameter | Description |
---|---|
aKey | Key of setting to be read. |
aValue | Returns the value of the setting if it is a descriptor. |
Returns: 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.
Parameter | Description |
---|---|
aId | Key of setting to be read. |
aValue | Returns the value of the setting if it is a descriptor. |
aActualLength | Returns the actual length of the setting if it is a descriptor. |
Returns: 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.
Parameter | Description |
---|---|
aKey | The key |
aMeta | Returns the metadata value for the key |
Returns: 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, plus other system-wide error codes.
IMPORT_C TInt | Move | ( | TUint32 | aSourcePartialKey, |
TUint32 | aTargetPartialKey, | |||
TUint32 | aMask, | |||
TUint32 & | aErrorKey | |||
) |
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);
Parameter | Description |
---|---|
aSourcePartialKey | Contains a bit pattern that all the source keys which must at least partially match. |
aTargetPartialKey | Contains a bit pattern that all the target keys which must at least partially match. |
aMask | Has bits set for all the bits in aPartialKey that must match the keys being moved. |
aErrorKey | on failure, contains the key or partial key involved in the error or KUnspecifiedKey if failure could not be attributed to any key. |
Returns: KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrNotFound if no items were found in the source range. KErrPermissionDenied if caller fails capability check, KErrAlreadyExists if an existing setting is using any intended target key. plus other system-wide error codes.
IMPORT_C CRepository * | NewL | ( | TUid | aRepositoryUid | ) | [static] |
Creates a CRepository object for accessing a repository. If there is no such repository, the function leaves with KErrNotFound.
Parameter | Description |
---|---|
aRepositoryUid | The UID of the repository to be accessed |
Returns: A pointer to a newly created CRepository object
IMPORT_C CRepository * | NewLC | ( | TUid | aRepositoryUid | ) | [static] |
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.
Parameter | Description |
---|---|
aRepositoryUid | The UID of the repository to be accessed |
Returns: A pointer to a newly created CRepository object
Cancels a notification previously requested from the three-argument overload of NotifyRequest.
Parameter | Description |
---|---|
aPartialKey | The parameter to the previous call to NotifyRequest to be cancelled. |
aMask | The mask to be used with the partial key |
Returns: KErrNone The method always returns KErrNone.
IMPORT_C TInt | NotifyCancelAll | ( | ) |
Cancels all uncompleted notifications from this CRepository.
Returns: KErrNone The method always returns KErrNone.
IMPORT_C TInt | NotifyRequest | ( | TUint32 | aKey, |
TRequestStatus & | aStatus | |||
) |
Parameter | Description |
---|---|
aKey | The key setting to be informed about. |
aStatus | The object that will receive the notification. On a successful outcome, this will contain the Uid of the changed setting. If there is an existing notification on the same setting and same session, aStatus will be set to KErrAlreadyExists and the return value will be KErrNone. |
Returns: KErrNone if successful or if aStatus is set to KErrAlreadyExists. KErrPermissionDenied if caller fails capability check. KErrNotFound if the requested setting does not exist.
IMPORT_C TInt | NotifyRequest | ( | TUint32 | aPartialKey, |
TUint32 | aMask, | |||
TRequestStatus & | aStatus | |||
) |
Parameter | Description |
---|---|
aPartialKey | The partial key setting to be informed about. |
aMask | The mask to be used with the partial key. |
aStatus | The object that will receive the notification. On a successful outcome, this will contain the Uid of the changed setting. On error the error code is stored in aStatus and KErrNone is returned. |
Returns: KErrNone The method always returns KErrNone.
IMPORT_C TInt | Reset | ( | ) |
Returns: KErrNone if successful, KErrNotSupported if this client session is in a transaction plus other system-wide error codes.
Parameter | Description |
---|---|
aKey | Key of setting to be reset. |
Returns: KErrNone if successful, KErrNotSupported if this client session is in a transaction plus other system-wide error codes.
void | RollbackTransaction | ( | ) | [inline] |
Same as CancelTransaction.
See also: CancelTransaction
Parameter | Description |
---|---|
aKey | Key of setting to be written to. |
aValue | Value to be written. |
Returns: KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrArgument if the setting exists but is not an integer plus other system-wide error codes.
Parameter | Description |
---|---|
aKey | Key of setting to be written to. |
aValue | Value to be written. |
Returns: KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrArgument if the setting exists but is not a floating point value plus other system-wide error codes.
Parameter | Description |
---|---|
aKey | Key of setting to be written to. |
aValue | Value to be written. |
Returns: KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrArgument if aValue is longer than KMaxBinaryLength or the setting exists but is not a descriptor, plus other system-wide error codes.
Parameter | Description |
---|---|
aKey | Key of setting to be written to. |
aValue | Value to be written. |
Returns: KErrNone if successful, KErrAbort if in a transaction that has previously failed KErrPermissionDenied if caller fails capability check, KErrArgument if aValue is longer than KMaxUnicodeStringLength or the setting exists but is not a descriptor, plus other system-wide error codes.
IMPORT_C TInt | StartTransaction | ( | TTransactionMode | aMode | ) |
Attempts to starts a transaction in the given mode. Consistency and persistence of all values read and written during the transaction is only guaranteed after a successful return from CommitTransaction.
See also: CRepository::TTransactionMode
Parameter | Description |
---|---|
aMode | transaction mode: EConcurrentReadWriteTransaction (standard), EReadTransaction or EReadWriteTransaction. |
Returns: KErrNone if successful - guaranteed for EConcurrentReadWriteTransaction, KErrLocked for other transaction types if read or write locks held by other clients prevent transaction from starting.
IMPORT_C void | StartTransaction | ( | TTransactionMode | aMode, |
TRequestStatus & | aStatus | |||
) |
Attempts to starts a transaction in the given mode asynchronously to allow client to avoid being blocked by server activity before starting. Consistency and persistence of all values read and written during the transaction is only guaranteed after a successful return from CommitTransaction. Use CancelTransaction to cancel asynchronous request.
See also: CRepository::TTransactionMode
Parameter | Description |
---|---|
aMode | transaction mode: EConcurrentReadWriteTransaction (standard), EReadTransaction or EReadWriteTransaction. |
aStatus | On completion of asynchronous request: KErrNone if successful - guaranteed for EConcurrentReadWriteTransaction unless cancelled, KErrLocked for other transaction types if read or write locks held by other clients prevent transaction from starting. |