CRepository Class Reference

class CRepository : public CBase

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.

Inherits from

Public Member Functions
~CRepository()
IMPORT_C voidCancelTransaction()
IMPORT_C voidCleanupCancelTransactionPushL()
IMPORT_C voidCleanupFailTransactionPushL()
voidCleanupRollbackTransactionPushL()
IMPORT_C TIntCommitTransaction(TUint32 &)
IMPORT_C voidCommitTransaction(TDes8 &, TRequestStatus &)
IMPORT_C TIntCreate(TUint32, TInt)
IMPORT_C TIntCreate(TUint32, const TReal &)
IMPORT_C TIntCreate(TUint32, const TDesC8 &)
IMPORT_C TIntCreate(TUint32, const TDesC16 &)
IMPORT_C TIntDelete(TUint32)
IMPORT_C TIntDelete(TUint32, TUint32, TUint32 &)
IMPORT_C voidFailTransaction()
IMPORT_C TIntFindEqL(TUint32, TUint32, TInt, RArray< TUint32 > &)
IMPORT_C TIntFindEqL(TUint32, TUint32, const TReal &, RArray< TUint32 > &)
IMPORT_C TIntFindEqL(TUint32, TUint32, const TDesC8 &, RArray< TUint32 > &)
IMPORT_C TIntFindEqL(TUint32, TUint32, const TDesC16 &, RArray< TUint32 > &)
IMPORT_C TIntFindL(TUint32, TUint32, RArray< TUint32 > &)
IMPORT_C TIntFindNeqL(TUint32, TUint32, TInt, RArray< TUint32 > &)
IMPORT_C TIntFindNeqL(TUint32, TUint32, const TReal &, RArray< TUint32 > &)
IMPORT_C TIntFindNeqL(TUint32, TUint32, const TDesC8 &, RArray< TUint32 > &)
IMPORT_C TIntFindNeqL(TUint32, TUint32, const TDesC16 &, RArray< TUint32 > &)
IMPORT_C TIntGet(TUint32, TInt &)
IMPORT_C TIntGet(TUint32, TReal &)
IMPORT_C TIntGet(TUint32, TDes8 &)
IMPORT_C TIntGet(TUint32, TDes8 &, TInt &)
IMPORT_C TIntGet(TUint32, TDes16 &)
IMPORT_C TIntGet(TUint32, TDes16 &, TInt &)
IMPORT_C TIntGetMeta(TUint32, TUint32 &)
IMPORT_C TIntMove(TUint32, TUint32, TUint32, TUint32 &)
IMPORT_C CRepository *NewL(TUid)
IMPORT_C CRepository *NewLC(TUid)
IMPORT_C TIntNotifyCancel(TUint32)
IMPORT_C TIntNotifyCancel(TUint32, TUint32)
IMPORT_C TIntNotifyCancelAll()
IMPORT_C TIntNotifyRequest(TUint32, TRequestStatus &)
IMPORT_C TIntNotifyRequest(TUint32, TUint32, TRequestStatus &)
IMPORT_C TIntReset()
IMPORT_C TIntReset(TUint32)
voidRollbackTransaction()
IMPORT_C TIntSet(TUint32, TInt)
IMPORT_C TIntSet(TUint32, const TReal &)
IMPORT_C TIntSet(TUint32, const TDesC8 &)
IMPORT_C TIntSet(TUint32, const TDesC16 &)
IMPORT_C TIntStartTransaction(TTransactionMode)
IMPORT_C voidStartTransaction(TTransactionMode, TRequestStatus &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTTransactionMode { EConcurrentReadWriteTransaction = 2, EReadTransaction = 1, EReadWriteTransaction = 3 }
Public Member Type Definitions
typedef TPckgBuf< TUint32 > TTransactionKeyInfoBuf

Constructor & Destructor Documentation

~CRepository()

IMPORT_C~CRepository()[virtual]

Destructor.

Member Functions Documentation

CancelTransaction()

IMPORT_C voidCancelTransaction()
Cancels the current transaction with rollback: discards any uncommitted changes. If the transaction is pending start or commit asynchronously, the request is completed with KErrCancel (unless it had already completed).
Post-condition
Not in a transaction.

CleanupCancelTransactionPushL()

IMPORT_C voidCleanupCancelTransactionPushL()
Pushes onto the CleanupStack a TCleanupItem that calls CancelTransaction if activated by a Leave or PopAndDestroy. Important for releasing transaction resources including caches and read/write locks held over the repository.
Post-condition
CleanupStack has another item on it which must be popped later with CleanupStack::Pop() or similar.

CleanupFailTransactionPushL()

IMPORT_C voidCleanupFailTransactionPushL()
Pushes onto the CleanupStack a TCleanupItem that calls FailTransaction if activated by a Leave or PopAndDestroy.
Post-condition
CleanupStack has another item on it which must be popped later with CleanupStack::Pop() or similar.

CleanupRollbackTransactionPushL()

voidCleanupRollbackTransactionPushL()[inline]

Same as CleanupCancelTransactionPushL. CleanupCancelTransactionPushL

CommitTransaction(TUint32 &)

IMPORT_C TIntCommitTransaction(TUint32 &aKeyInfo)
Commits a transaction. A successful return guarantees the consistency and persistence of all values read and written during the transaction.
Pre-condition
Must be in a transaction.
Post-condition
Not in a transaction. On success, changes have been made persistent. On failure, transaction changes have been rolled back.
panic
CENREPCLI 4 Panics client if this session is not in a transaction.

Parameters

TUint32 & aKeyInfoOn 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.

CommitTransaction(TDes8 &, TRequestStatus &)

IMPORT_C voidCommitTransaction(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. CRepository::TTransactionKeyInfoBuf
Pre-condition
Must be in a transaction.
Post-condition
Cannot assume that transaction is "pending commit" as may have completed already. Once request is complete, session is not in a transaction: on success, changes have been made persistent; on failure, transaction changes have been rolled back.
panic
CENREPCLI 4 Panics client if this session is not in a transaction.

Parameters

TDes8 & aKeyInfoA 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.
TRequestStatus & aStatusCompletion 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.

Create(TUint32, TInt)

IMPORT_C TIntCreate(TUint32aKey,
TIntaValue
)
Creates a new setting with an integer value.
Post-condition
Transactions fail on all error conditions. Outside transactions: on success the new setting is persistent, on failure the repository is unmodified.
capability
Dependent Caller must satisfy the write access policy of that key in the repository.

Parameters

TUint32 aKeyNew setting key.
TInt aValueSetting value.

Create(TUint32, const TReal &)

IMPORT_C TIntCreate(TUint32aKey,
const TReal &aValue
)
Creates a new setting with a floating-point value.
Post-condition
Transactions fail on all error conditions. Outside transactions: on success the new setting is persistent, on failure the repository is unmodified.
capability
Dependent Caller must satisfy the write access policy of that key in the repository.

Parameters

TUint32 aKeyNew setting key.
const TReal & aValueSetting value.

Create(TUint32, const TDesC8 &)

IMPORT_C TIntCreate(TUint32aKey,
const TDesC8 &aValue
)
Creates a new setting with a descriptor value.
Post-condition
Transactions fail on all error conditions. Outside transactions: on success the new setting is persistent, on failure the repository is unmodified.
capability
Dependent Caller must satisfy the write access policy of that key in the repository.

Parameters

TUint32 aKeyNew setting key.
const TDesC8 & aValueSetting value.

Create(TUint32, const TDesC16 &)

IMPORT_C TIntCreate(TUint32aKey,
const TDesC16 &aValue
)
Creates a new setting with a descriptor value.
Post-condition
Transactions fail on all error conditions. Outside transactions: on success the new setting is persistent, on failure the repository is unmodified.
capability
Dependent Caller must satisfy the write access policy of that key in the repository.

Parameters

TUint32 aKeyNew setting key.
const TDesC16 & aValueSetting value.

Delete(TUint32)

IMPORT_C TIntDelete(TUint32aKey)
Deletes a setting.
Post-condition
Transactions fail on all error conditions except KErrNotFound. Outside transactions: on success the deletion of the setting is persistent, on failure the repository is unmodified.
capability
Dependent Caller must satisfy the write access policy for that key in the repository

Parameters

TUint32 aKeyKey of setting to be deleted.

Delete(TUint32, TUint32, TUint32 &)

IMPORT_C TIntDelete(TUint32aPartialKey,
TUint32aMask,
TUint32 &aErrorKey
)
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);

Post-condition
Transactions fail on all error conditions except KErrNotFound Outside transactions: on success the changes are persistent, on failure the repository is unmodified.
capability
Dependent Caller must satisfy the write policies of all settings found in the partial key range.

Parameters

TUint32 aPartialKeyContains a bit pattern that all the keys must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the keys being deleted.
TUint32 & aErrorKeyIf 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

FailTransaction()

IMPORT_C voidFailTransaction()
Sets the active transaction to a failed state, releasing cache and locks but keeping it open. Has no effect when not in an active transaction, including when it has already failed or when pending asynchronous start or commit request completion. Use in preference to CancelTransaction whenever it is inappropriate to close the transaction at the time.
Post-condition
If previously in an active transaction: It is marked as failed. All uncommitted changes are discarded. Transaction resources including cache and read/write locks are released in the repository. All subsequent operations in the transaction fail until it is closed by CancelTransaction or CommitTransaction. CommitTransaction will fail and return KErrAbort.

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

IMPORT_C TIntFindEqL(TUint32aPartialKey,
TUint32aMask,
TIntaValue,
RArray< TUint32 > &aFoundKeys
)
Finds all the settings that contain a given integer and match the specification given by aPartialKey and aMask. FindL()
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read policies of all settings found in the source range.

Parameters

TUint32 aPartialKeyContains a bit pattern that all the keys returned must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the returned keys.
TInt aValueSettings for the keys found will be integers with value aValue.
RArray< TUint32 > & aFoundKeysAll the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is an integer aValue.

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

IMPORT_C TIntFindEqL(TUint32aPartialKey,
TUint32aMask,
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. FindL()
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read policies of all settings found in the source range.

Parameters

TUint32 aPartialKeyContains a bit pattern that all the keys returned must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the returned keys.
const TReal & aValueSettings for the keys found will be floating point values with value aValue.
RArray< TUint32 > & aFoundKeysAll 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.

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

IMPORT_C TIntFindEqL(TUint32aPartialKey,
TUint32aMask,
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. FindL()
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read policies of all settings found in the source range.

Parameters

TUint32 aPartialKeyContains a bit pattern that all the keys returned must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the returned keys.
const TDesC8 & aValueSettings for the keys found will be string values with value aValue.
RArray< TUint32 > & aFoundKeysAll the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is a string value aValue.

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

IMPORT_C TIntFindEqL(TUint32aPartialKey,
TUint32aMask,
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. FindL()
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read policies of all settings found in the source range.

Parameters

TUint32 aPartialKeyContains a bit pattern that all the keys returned must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the returned keys.
const TDesC16 & aValueSettings for the keys found will be string values with value aValue.
RArray< TUint32 > & aFoundKeysAll the keys found. For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and the setting with key k is a string value aValue.

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

IMPORT_C TIntFindL(TUint32aPartialKey,
TUint32aMask,
RArray< TUint32 > &aFoundKeys
)
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 aPartialKeyContains a bit pattern that all the keys returned must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the returned keys.
RArray< TUint32 > & aFoundKeysAll the keys found.

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

IMPORT_C TIntFindNeqL(TUint32aPartialKey,
TUint32aMask,
TIntaValue,
RArray< TUint32 > &aFoundKeys
)
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. FindL()
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read policies of all settings found in the source range.

Parameters

TUint32 aPartialKeyContains a bit pattern that all the keys returned must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the returned keys.
TInt aValueSettings for the keys found will be settings that either contain values that are not integers or integers other than aValue.
RArray< TUint32 > & aFoundKeysAll 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.

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

IMPORT_C TIntFindNeqL(TUint32aPartialKey,
TUint32aMask,
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. FindL()
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read policies of all settings found in the source range.

Parameters

TUint32 aPartialKeyContains a bit pattern that all the keys returned must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the returned keys.
const TReal & aValueSettings 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 > & aFoundKeysAll 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.

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

IMPORT_C TIntFindNeqL(TUint32aPartialKey,
TUint32aMask,
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. FindL()
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read policies of all settings found in the source range.

Parameters

TUint32 aPartialKeyContains a bit pattern that all the keys returned must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the returned keys.
const TDesC8 & aValueSettings for the keys found will be settings that either contain values that are not strings or strings with value other than aValue.
RArray< TUint32 > & aFoundKeysAll 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.

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

IMPORT_C TIntFindNeqL(TUint32aPartialKey,
TUint32aMask,
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. FindL()
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read policies of all settings found in the source range.

Parameters

TUint32 aPartialKeyContains a bit pattern that all the keys returned must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the returned keys.
const TDesC16 & aValueSettings for the keys found will be settings that either contain values that are not strings or strings with value other than aValue.
RArray< TUint32 > & aFoundKeysAll 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.

Get(TUint32, TInt &)

IMPORT_C TIntGet(TUint32aKey,
TInt &aValue
)
Reads an integer setting.
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read access policy of that key in the repository.

Parameters

TUint32 aKeyKey of setting to be read.
TInt & aValueReturns the value of the setting if it is an integer.

Get(TUint32, TReal &)

IMPORT_C TIntGet(TUint32aKey,
TReal &aValue
)
Reads a floating point setting.
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read access policy of that key in the repository.

Parameters

TUint32 aKeyKey of setting to be read.
TReal & aValueReturns the value of the setting if it is a floating point value.

Get(TUint32, TDes8 &)

IMPORT_C TIntGet(TUint32aKey,
TDes8 &aValue
)
Reads a descriptor setting.
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read access policy of that key in the repository.

Parameters

TUint32 aKeyKey of setting to be read.
TDes8 & aValueReturns the value of the setting if it is a descriptor.

Get(TUint32, TDes8 &, TInt &)

IMPORT_C TIntGet(TUint32aId,
TDes8 &aValue,
TInt &aActualLength
)
Reads a descriptor setting.
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read access policy of that key in the repository.

Parameters

TUint32 aIdKey of setting to be read.
TDes8 & aValueReturns the value of the setting if it is a descriptor.
TInt & aActualLengthReturns the actual length of the setting if it is a descriptor.

Get(TUint32, TDes16 &)

IMPORT_C TIntGet(TUint32aKey,
TDes16 &aValue
)
Reads a descriptor setting.
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read access policy of that key in the repository.

Parameters

TUint32 aKeyKey of setting to be read.
TDes16 & aValueReturns the value of the setting if it is a descriptor.

Get(TUint32, TDes16 &, TInt &)

IMPORT_C TIntGet(TUint32aId,
TDes16 &aValue,
TInt &aActualLength
)
Reads a descriptor setting.
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read access policy of that key in the repository.

Parameters

TUint32 aIdKey of setting to be read.
TDes16 & aValueReturns the value of the setting if it is a descriptor.
TInt & aActualLengthReturns the actual length of the setting if it is a descriptor.

GetMeta(TUint32, TUint32 &)

IMPORT_C TIntGetMeta(TUint32aKey,
TUint32 &aMeta
)
Reads the metadata bound to a key
Post-condition
Transactions fail only on those "other system-wide error codes".
capability
Dependent Caller must satisfy the read access policy of that key in the repository.

Parameters

TUint32 aKeyThe key
TUint32 & aMetaReturns the metadata value for the key

Move(TUint32, TUint32, TUint32, TUint32 &)

IMPORT_C TIntMove(TUint32aSourcePartialKey,
TUint32aTargetPartialKey,
TUint32aMask,
TUint32 &aErrorKey
)
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);

Post-condition
Transactions fail on all error conditions except KErrNotFound. Outside transactions: on success the changes are persistent, on failure the repository is unmodified.
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.

Parameters

TUint32 aSourcePartialKeyContains a bit pattern that all the source keys which must at least partially match.
TUint32 aTargetPartialKeyContains a bit pattern that all the target keys which must at least partially match.
TUint32 aMaskHas bits set for all the bits in aPartialKey that must match the keys being moved.
TUint32 & aErrorKeyon failure, contains the key or partial key involved in the error or KUnspecifiedKey if failure could not be attributed to any key.

NewL(TUid)

IMPORT_C CRepository *NewL(TUidaRepositoryUid)[static]

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

Parameters

TUid aRepositoryUidThe UID of the repository to be accessed

NewLC(TUid)

IMPORT_C CRepository *NewLC(TUidaRepositoryUid)[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

TUid aRepositoryUidThe UID of the repository to be accessed

NotifyCancel(TUint32)

IMPORT_C TIntNotifyCancel(TUint32aKey)

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

Parameters

TUint32 aKeyThe parameter to the previous call to NotifyRequest to be cancelled.

NotifyCancel(TUint32, TUint32)

IMPORT_C TIntNotifyCancel(TUint32aPartialKey,
TUint32aMask
)

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

Parameters

TUint32 aPartialKeyThe parameter to the previous call to NotifyRequest to be cancelled.
TUint32 aMaskThe mask to be used with the partial key

NotifyCancelAll()

IMPORT_C TIntNotifyCancelAll()

Cancels all uncompleted notifications from this CRepository.

NotifyRequest(TUint32, TRequestStatus &)

IMPORT_C TIntNotifyRequest(TUint32aKey,
TRequestStatus &aStatus
)
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.
capability
Note The caller must satisfy the relevant access policies for the repository

Parameters

TUint32 aKeyThe key setting to be informed about.
TRequestStatus & aStatusThe 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.

NotifyRequest(TUint32, TUint32, TRequestStatus &)

IMPORT_C TIntNotifyRequest(TUint32aPartialKey,
TUint32aMask,
TRequestStatus &aStatus
)
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.
capability
Note The caller must satisfy the relevant access policies for the repository

Parameters

TUint32 aPartialKeyThe partial key setting to be informed about.
TUint32 aMaskThe mask to be used with the partial key.
TRequestStatus & aStatusThe 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.

Reset()

IMPORT_C TIntReset()
Resets the whole repository to the state of the initialization file originally used to set it up. Not currently supported in transactions.
Post-condition
Fails transaction if called when session is in one.
capability
Dependent The caller must satisfy the relevant access policies for the repository

Reset(TUint32)

IMPORT_C TIntReset(TUint32aKey)
Resets the a setting within the repository to the state of the setting described by the initialization file originally used to set the repository up. Not currently supported in transactions.
Post-condition
Fails transaction if called when session is in one.
capability
Note The caller must satisfy the relevant access policies for the repository

Parameters

TUint32 aKeyKey of setting to be reset.

RollbackTransaction()

voidRollbackTransaction()[inline]

Same as CancelTransaction. CancelTransaction

Set(TUint32, TInt)

IMPORT_C TIntSet(TUint32aKey,
TIntaValue
)
Sets an existing integer setting to a new value or creates a new setting with an integer value if the setting doesn't exist.
Post-condition
Transactions fail on all error conditions. Outside transactions: on success the new value is persistent, on failure the repository is unmodified.
capability
Dependent Caller must satisfy the write access policy of that key in the repository.

Parameters

TUint32 aKeyKey of setting to be written to.
TInt aValueValue to be written.

Set(TUint32, const TReal &)

IMPORT_C TIntSet(TUint32aKey,
const TReal &aValue
)
Sets an existing floating point setting to a new value or creates a new setting with a floating point value if the setting doesn't exist.
Post-condition
Transactions fail on all error conditions. Outside transactions: on success the new value is persistent, on failure the repository is unmodified.
capability
Dependent Caller must satisfy the write access policy of that key in the repository.

Parameters

TUint32 aKeyKey of setting to be written to.
const TReal & aValueValue to be written.

Set(TUint32, const TDesC8 &)

IMPORT_C TIntSet(TUint32aKey,
const TDesC8 &aValue
)
Sets an existing descriptor setting to a new value or creates a new setting with a descriptor value if the setting doesn't exist.
Post-condition
Transactions fail on all error conditions. Outside transactions: on success the new value is persistent, on failure the repository is unmodified.
capability
Dependent Caller must satisfy the write access policy of that key in the repository.

Parameters

TUint32 aKeyKey of setting to be written to.
const TDesC8 & aValueValue to be written.

Set(TUint32, const TDesC16 &)

IMPORT_C TIntSet(TUint32aKey,
const TDesC16 &aValue
)
Sets an existing descriptor setting to a new value or creates a new setting with a descriptor value if it doesn't exist.
Post-condition
Transactions fail on all error conditions. Outside transactions: on success the new value is persistent, on failure the repository is unmodified.
capability
Dependent Caller must satisfy the write access policy of that key in the repository.

Parameters

TUint32 aKeyKey of setting to be written to.
const TDesC16 & aValueValue to be written.

StartTransaction(TTransactionMode)

IMPORT_C TIntStartTransaction(TTransactionModeaMode)
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. CRepository::TTransactionMode
Pre-condition
Must not be in a transaction.
Post-condition
If it returns KErrNone: in a transaction; Any other error code: not in a transaction.
panic
CENREPCLI 3 Panics client if this session is already in a transaction.

Parameters

TTransactionMode aModetransaction mode: EConcurrentReadWriteTransaction (standard), EReadTransaction or EReadWriteTransaction.

StartTransaction(TTransactionMode, TRequestStatus &)

IMPORT_C voidStartTransaction(TTransactionModeaMode,
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. CRepository::TTransactionMode
Pre-condition
Must not be in a transaction.
Post-condition
If it completes with KErrNone and request not cancelled: in a transaction; Any other error code or request cancelled: not in a transaction.
panic
CENREPCLI 3 Panics client if this session is already in a transaction.

Parameters

TTransactionMode aModetransaction mode: EConcurrentReadWriteTransaction (standard), EReadTransaction or EReadWriteTransaction.
TRequestStatus & aStatusOn 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.

Member Enumerations Documentation

Enum TTransactionMode

Transaction mode chosen with StartTransaction.

Enumerators

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.

Member Type Definitions Documentation

Typedef TTransactionKeyInfoBuf

typedef TPckgBuf< TUint32 >TTransactionKeyInfoBuf

Buffer type for aKeyInfo parameter to asynchronous CommitTransaction. CRepository::CommitTransaction(TDes8& aKeyInfo, TRequestStatus& aStatus)