/** Reads a descriptor setting. @param aKey Key of setting to be read. @param aValue Returns the value of the setting if it is a descriptor. @return KErrNone if successful, 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. @post 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. */ EXPORT_C TInt CRepository::Get(TUint32 aKey, TDes16& aValue) { TPtr8 ptr8((TUint8*)aValue.Ptr(), 0, aValue.MaxSize()); TInt ret=Get(aKey,ptr8); if (ret==KErrNone) aValue.SetLength(ptr8.Length()/2); return ret; }
/** Reads a descriptor setting. @param aKey Key of setting to be read. @param aValue Returns the value of the setting if it is a descriptor. @param aActualLength Returns the actual length of the setting if it is a descriptor. @return KErrNone if successful, 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. @post 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. */ EXPORT_C TInt CRepository::Get(TUint32 aKey, TDes16& aValue, TInt& aActualLength) { TInt actualLength8; TPtr8 ptr8((TUint8*)aValue.Ptr(), 0, aValue.MaxSize()); TInt ret=Get(aKey,ptr8,actualLength8); aValue.SetLength(ptr8.Length()/2); aActualLength=actualLength8/2; return ret; }