#include <centralrepository.h>
Link against: centralrepository.lib
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.
Enumerator | Value | Description |
---|---|---|
EConcurrentReadWriteTransaction | 2 |
Standard optimistic non-serialised transaction. Can be started at any time Commit fails with KErrLocked if another client interrupts it by first committing changes: transaction should be repeated until KErrLocked is not returned. |
EReadTransaction | 1 |
Pessimistic locking transaction intended for reading consistent values. Can only be started if EReadWriteTransaction is not in progress. Automatically promoted to EReadWriteTransaction on first write operation if no other read transaction is in progress (or fails if not attainable). Use ONLY if all clients can agree not to use EConcurrentReadWriteTransaction, and only make changes in an EReadWriteTransaction. |
EReadWriteTransaction | 3 |
Pessimistic locking transaction intended for writing values. Can only be started if no EReadTransaction or EReadWriteTransactions are in progress. Use ONLY if all clients can agree not to use EConcurrentReadWriteTransaction, and only make changes in an EReadWriteTransaction. |
IMPORT_C void | CancelTransaction | ( | ) |
IMPORT_C void | CleanupCancelTransactionPushL | ( | ) |
IMPORT_C void | CleanupFailTransactionPushL | ( | ) |
void | CleanupRollbackTransactionPushL | ( | ) | [inline] |
Same as CleanupCancelTransactionPushL.
See also: CleanupCancelTransactionPushL
Parameters | |
---|---|
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. |
Panic Codes | |
---|---|
CENREPCLI | 4 Panics client if this session is not in a transaction. |
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
Parameters | |
---|---|
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. |
Panic Codes | |
---|---|
CENREPCLI | 4 Panics client if this session is not in a transaction. |
Parameters | |
---|---|
aKey | New setting key. |
aValue | Setting value. |
Capability | |
---|---|
Dependent | Caller must satisfy the write access policy of that key in the repository. |
Parameters | |
---|---|
aKey | New setting key. |
aValue | Setting value. |
Capability | |
---|---|
Dependent | Caller must satisfy the write access policy of that key in the repository. |
Parameters | |
---|---|
aKey | New setting key. |
aValue | Setting value. |
Capability | |
---|---|
Dependent | Caller must satisfy the write access policy of that key in the repository. |
Parameters | |
---|---|
aKey | New setting key. |
aValue | Setting value. |
Capability | |
---|---|
Dependent | Caller must satisfy the write access policy of that key in the repository. |
Parameters | |
---|---|
aKey | Key of setting to be deleted. |
Capability | |
---|---|
Dependent | Caller must satisfy the write access policy for that key in the repository |
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 | |
---|---|
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 |
Capability | |
---|---|
Dependent | Caller must satisfy the write policies of all settings found in the partial key range. |
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()
See also: CClientRepository::FindEqL(TUint32 aPartialId, TUint32 aIdMask, TInt aVal, RArray<TUint32>& aFoundIds)
Parameters | |
---|---|
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. |
Leave Codes | |
---|---|
KErrNoMemory | The operation has failed with "out of memory" error. |
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 | |||
) |
Finds all the settings that contain a given floating point value and match the specification given by aPartialKey and aMask.
See also: FindL()
See also: CClientRepository::FindEqL(TUint32 aPartialId, TUint32 aIdMask, const TReal& aVal, RArray<TUint32>& aFoundIds)
Parameters | |
---|---|
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. |
Leave Codes | |
---|---|
KErrNoMemory | The operation has failed with "out of memory" error. |
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 | |||
) |
Finds all the settings that contain a given string value and match the specification given by aPartialKey and aMask.
See also: FindL()
See also: CClientRepository::FindEqL(TUint32 aPartialId, TUint32 aIdMask, const TDesC8& aVal, RArray<TUint32>& aFoundIds)
Parameters | |
---|---|
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. |
Leave Codes | |
---|---|
KErrNoMemory | The operation has failed with "out of memory" error. |
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 | |||
) |
Finds all the settings that contain a given string value and match the specification given by aPartialKey and aMask.
See also: FindL()
See also: CClientRepository::FindEqL(TUint32 aPartialId, TUint32 aIdMask, const TDesC& aVal, RArray<TUint32>& aFoundIds)
Parameters | |
---|---|
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. |
Leave Codes | |
---|---|
KErrNoMemory | The operation has failed with "out of memory" error. |
Capability | |
---|---|
Dependent | Caller must satisfy the read policies of all settings found in the source range. |
See also: CClientRepository::FindL(TUint32 aPartialId, TUint32 aIdMask, RArray<TUint32>& aFoundIds)
Parameters | |
---|---|
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. |
Leave Codes | |
---|---|
KErrNoMemory | The operation has failed with "out of memory" error. |
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()
See also: CClientRepository::FindNeqL(TUint32 aPartialId, TUint32 aIdMask, TInt aVal, RArray<TUint32>& aFoundIds)
Parameters | |
---|---|
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. |
Leave Codes | |
---|---|
KErrNoMemory | The operation has failed with "out of memory" error. |
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 | |||
) |
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()
See also: CClientRepository::FindNeqL(TUint32 aPartialId, TUint32 aIdMask, const TReal& aVal, RArray<TUint32>& aFoundIds)
Parameters | |
---|---|
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. |
Leave Codes | |
---|---|
KErrNoMemory | The operation has failed with "out of memory" error. |
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 | |||
) |
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()
See also: CClientRepository::FindNeqL(TUint32 aPartialId, TUint32 aIdMask, const TDesC8& aVal, RArray<TUint32>& aFoundIds)
Parameters | |
---|---|
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. |
Leave Codes | |
---|---|
KErrNoMemory | The operation has failed with "out of memory" error. |
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 | |||
) |
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()
See also: CClientRepository::FindNeqL(TUint32 aPartialId, TUint32 aIdMask, const TDesC& aVal, RArray<TUint32>& aFoundIds)
Parameters | |
---|---|
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. |
Leave Codes | |
---|---|
KErrNoMemory | The operation has failed with "out of memory" error. |
Capability | |
---|---|
Dependent | Caller must satisfy the read policies of all settings found in the source range. |
Parameters | |
---|---|
aKey | Key of setting to be read. |
aValue | Returns the value of the setting if it is an integer. |
Capability | |
---|---|
Dependent | Caller must satisfy the read access policy of that key in the repository. |
Parameters | |
---|---|
aKey | Key of setting to be read. |
aValue | Returns the value of the setting if it is a floating point value. |
Capability | |
---|---|
Dependent | Caller must satisfy the read access policy of that key in the repository. |
Parameters | |
---|---|
aKey | Key of setting to be read. |
aValue | Returns the value of the setting if it is a descriptor. |
Capability | |
---|---|
Dependent | Caller must satisfy the read access policy of that key in the repository. |
Parameters | |
---|---|
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. |
Capability | |
---|---|
Dependent | Caller must satisfy the read access policy of that key in the repository. |
Parameters | |
---|---|
aKey | Key of setting to be read. |
aValue | Returns the value of the setting if it is a descriptor. |
Capability | |
---|---|
Dependent | Caller must satisfy the read access policy of that key in the repository. |
Parameters | |
---|---|
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. |
Capability | |
---|---|
Dependent | Caller must satisfy the read access policy of that key in the repository. |
Parameters | |
---|---|
aKey | The key |
aMeta | Returns the metadata value for the key |
Capability | |
---|---|
Dependent | Caller must satisfy the read access policy of that key in the repository. |
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);
Parameters | |
---|---|
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. |
Capability | |
---|---|
Dependent | Caller must satisfy the read and write policies of all settings found in the source range, and write policies on all intended target keys. |
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.
Parameters | |
---|---|
aRepositoryUid | The UID of the repository to be accessed |
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.
Parameters | |
---|---|
aRepositoryUid | The UID of the repository to be accessed |
Cancels a notification previously requested from the three-argument overload of NotifyRequest.
Parameters | |
---|---|
aPartialKey | The parameter to the previous call to NotifyRequest to be cancelled. |
aMask | The mask to be used with the partial key |
IMPORT_C TInt | NotifyCancelAll | ( | ) |
Cancels all uncompleted notifications from this CRepository.
IMPORT_C TInt | NotifyRequest | ( | TUint32 | aKey, |
TRequestStatus & | aStatus | |||
) |
Parameters | |
---|---|
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. |
Capability | |
---|---|
Note | The caller must satisfy the relevant access policies for the repository |
IMPORT_C TInt | NotifyRequest | ( | TUint32 | aPartialKey, |
TUint32 | aMask, | |||
TRequestStatus & | aStatus | |||
) |
Parameters | |
---|---|
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. |
Capability | |
---|---|
Note | The caller must satisfy the relevant access policies for the repository |
IMPORT_C TInt | Reset | ( | ) |
Capability | |
---|---|
Dependent | The caller must satisfy the relevant access policies for the repository |
Parameters | |
---|---|
aKey | Key of setting to be reset. |
Capability | |
---|---|
Note | The caller must satisfy the relevant access policies for the repository |
void | RollbackTransaction | ( | ) | [inline] |
Same as CancelTransaction.
See also: CancelTransaction
Parameters | |
---|---|
aKey | Key of setting to be written to. |
aValue | Value to be written. |
Capability | |
---|---|
Dependent | Caller must satisfy the write access policy of that key in the repository. |
Parameters | |
---|---|
aKey | Key of setting to be written to. |
aValue | Value to be written. |
Capability | |
---|---|
Dependent | Caller must satisfy the write access policy of that key in the repository. |
Parameters | |
---|---|
aKey | Key of setting to be written to. |
aValue | Value to be written. |
Capability | |
---|---|
Dependent | Caller must satisfy the write access policy of that key in the repository. |
Parameters | |
---|---|
aKey | Key of setting to be written to. |
aValue | Value to be written. |
Capability | |
---|---|
Dependent | Caller must satisfy the write access policy of that key in the repository. |
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
Parameters | |
---|---|
aMode | transaction mode: EConcurrentReadWriteTransaction (standard), EReadTransaction or EReadWriteTransaction. |
Panic Codes | |
---|---|
CENREPCLI | 3 Panics client if this session is already in a transaction. |
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
Parameters | |
---|---|
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. |
Panic Codes | |
---|---|
CENREPCLI | 3 Panics client if this session is already in a transaction. |