Update contrib.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "centralrepository.h"
17 #include "heaprepos.h"
19 #include "pccenrepimpl.h"
21 /** Creates a CRepository object for accessing a repository.
22 If there is no such repository, the function leaves with KErrNotFound.
23 A pointer to the object is left on the cleanup stack.
24 @param aRepositoryUid The UID of the repository to be accessed
25 @return A pointer to a newly created CRepository object
28 EXPORT_C CRepository* CRepository::NewLC(TUid aRepositoryUid)
30 CRepository* self=new (ELeave)CRepository();
31 CleanupStack::PushL(self);
32 self->ConstructL(aRepositoryUid,KNullDesC,KNullDesC,ETrue);
37 /** Creates a CRepository object for accessing a repository.
38 If there is no such repository, the function leaves with KErrNotFound.
39 @param aRepositoryUid The UID of the repository to be accessed
40 @return A pointer to a newly created CRepository object
43 EXPORT_C CRepository* CRepository::NewL(TUid aRepositoryUid)
45 CRepository* self=CRepository::NewLC(aRepositoryUid);
51 Creates a CRepository object for accessing a repository specified in the input file
52 @param aInputFileName the location of the input file it should be in the format <file_path><XXXXXXXX><.txt/.cre> where XXXXXXXX is a 32 bit hex number
53 @param aOutputFileName the location fo the output it should be in the format <file_path><XXXXXXXX><.cre> where XXXXXXX is a 32 bit hex number
54 @leave KErrArgument if the file specified in the input and output do not follow the specification above
55 KErrCorrupt if the input file is corrupted
56 KErrNoMemory if run out of memory
58 EXPORT_C CRepository* CRepository::NewL(const TDesC& aInputRepositoryFile,const TDesC& aOutputRepositoryFile)
60 CRepository* self=CRepository::NewLC(aInputRepositoryFile,aOutputRepositoryFile);
66 Creates a CRepository object for accessing a repository specified in the input file.
67 A pointer to the object is left on the cleanup stack.
68 @param aInputFileName the location of the input file it should be in the format <file_path><XXXXXXXX><.txt/.cre> where XXXXXXXX is a 32 bit hex number
69 @param aOutputFileName the location fo the output it should be in the format <file_path><XXXXXXXX><.cre> where XXXXXXX is a 32 bit hex number
70 @leave KErrArgument if the file specified in the input and output do not follow the specification above
71 KErrCorrupt if the input file is corrupted
72 KErrNoMemory if run out of memory
74 EXPORT_C CRepository* CRepository::NewLC(const TDesC& aInputRepositoryFile,const TDesC& aOutputRepositoryFile)
76 CRepository* self=new (ELeave)CRepository();
77 CleanupStack::PushL(self);
78 self->ConstructL(KNullUid,aInputRepositoryFile,aOutputRepositoryFile,EFalse);
82 void CRepository::ConstructL(TUid aRepositoryUid,const TDesC& aInFileName,const TDesC& aOutFileName,TBool aAutoLoading)
84 iImpl = CPcRepImpl::NewL(aRepositoryUid,aInFileName,aOutFileName,aAutoLoading);
88 Flush any content of the repository in the heap to physical file, the target file is either the explicitly
89 specified output file or the implicitly determined output file depending on which NewL function is used
90 to construct the repository
91 @return KErrNone if successful,
92 plus other system-wide error codes.
94 EXPORT_C TInt CRepository::Flush()
96 return iImpl->Flush();
102 EXPORT_C CRepository::~CRepository()
108 /** Creates a new setting with an integer value.
109 @param aKey New setting key.
110 @param aValue Setting value.
112 KErrNone if successful,
113 KErrAlreadyExists if a setting with that key already exists
114 plus other system-wide error codes.
116 Transactions fail on all error conditions.
117 Outside transactions: on success the new setting is persistent,
118 on failure the repository is unmodified.
119 @capability Dependent Caller must satisfy the write access policy of that key in the repository.
121 EXPORT_C TInt CRepository::Create(TUint32 aKey, TInt aValue)
123 TRAPD(err,iImpl->CreateSettingL(aKey,aValue,NULL));
128 /** Creates a new setting with a floating-point value.
129 @param aKey New setting key.
130 @param aValue Setting value.
132 KErrNone if successful,
133 KErrAlreadyExists if a setting with that key already exists
134 plus other system-wide error codes.
136 Transactions fail on all error conditions.
137 Outside transactions: on success the new setting is persistent,
138 on failure the repository is unmodified.
139 @capability Dependent Caller must satisfy the write access policy of that key in the repository.
141 EXPORT_C TInt CRepository::Create(TUint32 aKey, const TReal& aValue)
143 TRAPD(err,iImpl->CreateSettingL(aKey,aValue,NULL));
148 /** Creates a new setting with a descriptor value.
149 @param aKey New setting key.
150 @param aValue Setting value.
152 KErrNone if successful,
153 KErrAlreadyExists if a setting with that key already exists
154 KErrArgument if the descriptor is longer than KMaxBinaryLength,
155 plus other system-wide error codes.
157 Transactions fail on all error conditions.
158 Outside transactions: on success the new setting is persistent,
159 on failure the repository is unmodified.
160 @capability Dependent Caller must satisfy the write access policy of that key in the repository.
162 EXPORT_C TInt CRepository::Create(TUint32 aKey, const TDesC8& aValue)
164 if (aValue.Length()>KMaxBinaryLength)
166 TRAPD(err,iImpl->CreateSettingL(aKey,aValue,NULL));
170 /** Creates a new setting with a descriptor value.
171 @param aKey New setting key.
172 @param aValue Setting value.
174 KErrNone if successful,
175 KErrAlreadyExists if a setting with that key already exists
176 KErrArgument if the descriptor is longer than KMaxUnicodeStringLength,
177 plus other system-wide error codes.
179 Transactions fail on all error conditions.
180 Outside transactions: on success the new setting is persistent,
181 on failure the repository is unmodified.
182 @capability Dependent Caller must satisfy the write access policy of that key in the repository.
184 EXPORT_C TInt CRepository::Create(TUint32 aKey, const TDesC16& aValue)
186 if (aValue.Length()>KMaxUnicodeStringLength)
188 TPtrC8 pVal((const TUint8*)aValue.Ptr(), aValue.Length()*2);
189 return Create(aKey,pVal);
192 /** Deletes a setting.
193 @param aKey Key of setting to be deleted.
195 KErrNone if successful,
196 KErrNotFound if the setting does not exist,
197 plus other system-wide error codes.
199 Transactions fail on all error conditions except KErrNotFound.
200 Outside transactions: on success the deletion of the setting is persistent,
201 on failure the repository is unmodified.
202 @capability Dependent Caller must satisfy the write access policy for that key in the repository
204 EXPORT_C TInt CRepository::Delete(TUint32 aKey)
206 TRAPD(err,iImpl->DeleteSettingL(aKey));
207 iImpl->RemoveAnyMarkDeleted();
211 /** Deletes all the settings that exist and match the specification:
212 (key & mask) == (partialKey & mask)
213 Partial key is guaranteed to be masked before use.
215 - To delete a single key.
216 Delete(key, 0xFFFFFFFF, errorKey);
217 - To delete all keys from 0 to 0xFF:
218 Delete(0, 0xFFFFFF00, errorKey);
219 (digits from 0 to 0xFF would be ignored if given in the partial key)
220 - To delete all keys matching 0x5B??3A?6:
221 Delete(0x5B003A06, 0xFF00FF0F, errorKey);
224 Contains a bit pattern that all the keys must at least partially
227 Has bits set for all the bits in aPartialKey that must match the keys being deleted.
228 @param aErrorKey If the delete operation fails this contains the key involved in the
229 failure, or aPartialKey or KUnspecifiedKey if it could not be attributed to any key
231 KErrNone if successful,
232 KErrNotFound if no items were found in the partial key range.
233 plus other system-wide error codes.
235 Transactions fail on all error conditions except KErrNotFound
236 Outside transactions: on success the changes are persistent, on failure the
237 repository is unmodified.
238 @capability Dependent Caller must satisfy the write policies of all settings found in the
241 EXPORT_C TInt CRepository::Delete(TUint32 aPartialKey, TUint32 aMask, TUint32& aErrorKey)
243 TRAPD(ret,iImpl->DeleteRangeL(aPartialKey,aMask,aErrorKey));
248 /** Reads an integer setting.
249 @param aKey Key of setting to be read.
250 @param aValue Returns the value of the setting if it is an integer.
252 KErrNone if successful,
253 KErrNotFound if the setting does not exist,
254 KErrArgument if the setting exists but is not an integer,
255 plus other system-wide error codes.
256 @post Transactions fail only on those "other system-wide error codes".
257 @capability Dependent Caller must satisfy the read access policy of that key in the repository.
259 EXPORT_C TInt CRepository::Get(TUint32 aKey, TInt& aValue)
261 return iImpl->Get(aKey,aValue);
264 /** Reads a floating point setting.
265 @param aKey Key of setting to be read.
266 @param aValue Returns the value of the setting if it is a floating point value.
268 KErrNone if successful,
269 KErrNotFound if the setting does not exist,
270 KErrArgument if the setting exists but is not a floating point value,
271 plus other system-wide error codes.
272 @post Transactions fail only on those "other system-wide error codes".
273 @capability Dependent Caller must satisfy the read access policy of that key in the repository.
275 EXPORT_C TInt CRepository::Get(TUint32 aKey, TReal& aValue)
277 return iImpl->Get(aKey,aValue);
280 /** Reads a descriptor setting.
281 @param aKey Key of setting to be read.
282 @param aValue Returns the value of the setting if it is a descriptor.
284 KErrNone if successful,
285 KErrNotFound if the setting does not exist,
286 KErrArgument if the setting exists but is not a descriptor,
287 KErrOverflow if the descriptor is too small to receive the value in the repository,
288 plus other system-wide error codes.
289 @post Transactions fail only on those "other system-wide error codes".
290 @capability Dependent Caller must satisfy the read access policy of that key in the repository.
292 EXPORT_C TInt CRepository::Get(TUint32 aKey, TDes8& aValue)
295 return Get(aKey,aValue,actual);
298 /** Reads a descriptor setting.
299 @param aKey Key of setting to be read.
300 @param aValue Returns the value of the setting if it is a descriptor.
301 @param aActualLength Returns the actual length of the setting if it is a descriptor.
303 KErrNone if successful,
304 KErrNotFound if the setting does not exist,
305 KErrArgument if the setting exists but is not a descriptor,
306 KErrOverflow if the descriptor is too small to receive the value in the repository,
307 plus other system-wide error codes.
308 @post Transactions fail only on those "other system-wide error codes".
309 @capability Dependent Caller must satisfy the read access policy of that key in the repository.
311 EXPORT_C TInt CRepository::Get(TUint32 aKey, TDes8& aValue, TInt& aActualLength)
313 TBuf8<KMaxBinaryLength> val;
314 TInt ret = iImpl->Get(aKey, val);
317 TInt settingValueLength=val.Length();
318 //now check whether any string overflow
319 if (settingValueLength > aValue.MaxLength())
321 aActualLength=settingValueLength;
322 aValue.Copy(val.Left(aValue.MaxLength()));
333 /** Reads a descriptor setting.
334 @param aKey Key of setting to be read.
335 @param aValue Returns the value of the setting if it is a descriptor.
337 KErrNone if successful,
338 KErrNotFound if the setting does not exist,
339 KErrArgument if the setting exists but is not a descriptor,
340 KErrOverflow if the descriptor is too small to receive the value in the repository,
341 plus other system-wide error codes.
342 @post Transactions fail only on those "other system-wide error codes".
343 @capability Dependent Caller must satisfy the read access policy of that key in the repository.
345 EXPORT_C TInt CRepository::Get(TUint32 aKey, TDes16& aValue)
347 TPtr8 ptr8((TUint8*)aValue.Ptr(), 0, aValue.MaxSize());
348 TInt ret=Get(aKey,ptr8);
350 aValue.SetLength(ptr8.Length()/2);
354 /** Reads a descriptor setting.
355 @param aKey Key of setting to be read.
356 @param aValue Returns the value of the setting if it is a descriptor.
357 @param aActualLength Returns the actual length of the setting if it is a descriptor.
359 KErrNone if successful,
360 KErrNotFound if the setting does not exist,
361 KErrArgument if the setting exists but is not a descriptor,
362 KErrOverflow if the descriptor is too small to receive the value in the repository,
363 plus other system-wide error codes.
364 @post Transactions fail only on those "other system-wide error codes".
365 @capability Dependent Caller must satisfy the read access policy of that key in the repository.
367 EXPORT_C TInt CRepository::Get(TUint32 aKey, TDes16& aValue, TInt& aActualLength)
370 TPtr8 ptr8((TUint8*)aValue.Ptr(), 0, aValue.MaxSize());
371 TInt ret=Get(aKey,ptr8,actualLength8);
372 aValue.SetLength(ptr8.Length()/2);
373 aActualLength=actualLength8/2;
377 /** Sets an existing integer setting to a new value or creates a new setting
378 with an integer value if the setting doesn't exist.
379 @param aKey Key of setting to be written to.
380 @param aValue Value to be written.
382 KErrNone if successful,
383 KErrArgument if the setting exists but is not an integer
384 plus other system-wide error codes.
386 Transactions fail on all error conditions.
387 Outside transactions: on success the new value is persistent,
388 on failure the repository is unmodified.
389 @capability Dependent Caller must satisfy the write access policy of that key in the repository.
391 EXPORT_C TInt CRepository::Set(TUint32 aKey, TInt aValue)
393 TRAPD(err,iImpl->SetSettingL(aKey,aValue));
397 /** Sets an existing floating point setting to a new value or creates a new setting
398 with a floating point value if the setting doesn't exist.
399 @param aKey Key of setting to be written to.
400 @param aValue Value to be written.
402 KErrNone if successful,
403 KErrArgument if the setting exists but is not a floating point value
404 plus other system-wide error codes.
406 Transactions fail on all error conditions.
407 Outside transactions: on success the new value is persistent,
408 on failure the repository is unmodified.
409 @capability Dependent Caller must satisfy the write access policy of that key in the repository.
411 EXPORT_C TInt CRepository::Set(TUint32 aKey, const TReal& aValue)
413 TRAPD(err,iImpl->SetSettingL(aKey,aValue));
417 /** Sets an existing descriptor setting to a new value or creates a new setting
418 with a descriptor value if the setting doesn't exist.
419 @param aKey Key of setting to be written to.
420 @param aValue Value to be written.
422 KErrNone if successful,
423 KErrArgument if aValue is longer than KMaxBinaryLength or
424 the setting exists but is not a descriptor,
425 plus other system-wide error codes.
427 Transactions fail on all error conditions.
428 Outside transactions: on success the new value is persistent,
429 on failure the repository is unmodified.
430 @capability Dependent Caller must satisfy the write access policy of that key in the repository.
432 EXPORT_C TInt CRepository::Set(TUint32 aKey, const TDesC8& aValue)
434 if (aValue.Length()>KMaxBinaryLength)
436 TRAPD(err,iImpl->SetSettingL(aKey,aValue));
440 /** Sets an existing descriptor setting to a new value or creates a new setting
441 with a descriptor value if it doesn't exist.
442 @param aKey Key of setting to be written to.
443 @param aValue Value to be written.
445 KErrNone if successful,
446 KErrArgument if aValue is longer than KMaxUnicodeStringLength or
447 the setting exists but is not a descriptor,
448 plus other system-wide error codes.
450 Transactions fail on all error conditions.
451 Outside transactions: on success the new value is persistent,
452 on failure the repository is unmodified.
453 @capability Dependent Caller must satisfy the write access policy of that key in the repository.
455 EXPORT_C TInt CRepository::Set(TUint32 aKey, const TDesC16& aValue)
457 if (aValue.Length()>KMaxUnicodeStringLength)
459 TPtrC8 pVal((const TUint8*)aValue.Ptr(), aValue.Length()*2);
460 return Set(aKey,pVal);
463 /** Reads the metadata bound to a key
465 @param aMeta Returns the metadata value for the key
467 KErrNone if successful,
468 KErrNotFound if the setting does not exist,
469 plus other system-wide error codes.
470 @post Transactions fail only on those "other system-wide error codes".
471 @capability Dependent Caller must satisfy the read access policy of that key in the repository.
473 EXPORT_C TInt CRepository::GetMeta(TUint32 aKey, TUint32& aMeta)
475 return iImpl->GetMeta(aKey,aMeta);
478 /** Moves all the settings that exist and match the specification:
479 (oldkey & mask) == (sourcePartialKey & mask)
480 to new locations where
481 (newkey & mask) == (targetPartialKey & mask).
482 For those keys that match the source specification, those bits in the key for
483 which the corresponding mask bit is zero remain unchanged. All remaining bits
484 change from (sourcePartialKey & mask) to (targetPartialKey & mask).
485 Both partial keys are guaranteed to be masked before use.
487 - To move a single key from oldKey to newKey.
488 Move(oldKey, newKey, 0xFFFFFFFF, errorKey);
489 - To move all keys from 0 to 0xFF to be from 0x100 to 0x1FF:
490 Move(0, 0x100, 0xFFFFFF00, errorKey);
491 (digits from 0 to 0xFF would be ignored if given in the partial keys)
492 - To move all keys matching 0x5B??3A?6 to 0xDC??44?F:
493 Move(0x5B003A06, 0xDC00440F, 0xFF00FF0F, errorKey);
495 @param aSourcePartialKey
496 Contains a bit pattern that all the source keys which must at least partially
499 Has bits set for all the bits in aPartialKey that must match the keys being moved.
500 @param aTargetPartialKey
501 Contains a bit pattern that all the target keys which must at least partially
503 @param aErrorKey on failure, contains the key or partial key involved in the error
504 or KUnspecifiedKey if failure could not be attributed to any key.
506 KErrNone if successful,
507 KErrNotFound if no items were found in the source range.
508 KErrAlreadyExists if an existing setting is using any intended target key.
509 plus other system-wide error codes.
511 Transactions fail on all error conditions except KErrNotFound.
512 Outside transactions: on success the changes are persistent, on failure the
513 repository is unmodified.
514 @capability Dependent Caller must satisfy the read and write policies of all settings found in the
515 source range, and write policies on all intended target keys.
517 EXPORT_C TInt CRepository::Move (TUint32 aSourcePartialKey, TUint32 aTargetPartialKey,
518 TUint32 aMask, TUint32& aErrorKey)
520 TRAPD(ret,iImpl->MoveL(aSourcePartialKey,aTargetPartialKey,aMask,aErrorKey));
525 /** Finds all the settings that exist and match the specification given by
526 aPartialKey and aMask.
527 Matches occur whenever (key & mask) == (partialKey & mask).
528 The partial key is guaranteed to be masked before use.
530 Contains a bit pattern that all the keys returned must at least partially
533 Has bits set for all the bits in aPartialKey that must match the returned
535 @param aFoundKeys All the keys found.
537 KErrNone if successful,
538 KErrNotFound if no items were found in the source range,
539 plus other system-wide error codes.
540 @post Transactions fail only on those "other system-wide error codes".
542 EXPORT_C TInt CRepository::FindL(TUint32 aPartialKey, TUint32 aMask,
543 RArray<TUint32>& aFoundKeys)
545 RArray<TUint32> dummy;
546 TRAPD(ret,iImpl->FindL(aPartialKey,aMask,aFoundKeys,KMaximumKey,dummy));
547 if (ret==KErrNoMemory)
548 User::LeaveNoMemory();
553 /** Finds all the settings that contain a given integer and match the
554 specification given by aPartialKey and aMask.
556 Contains a bit pattern that all the keys returned must at least partially
559 Has bits set for all the bits in aPartialKey that must match the returned
561 @param aValue Settings for the keys found will be integers with value aValue.
562 @param aFoundKeys All the keys found.
563 For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and
564 the setting with key k is an integer aValue.
567 KErrNone if successful,
568 KErrNotFound if capability check passed but no matching items are found,
569 plus other system-wide error codes.
570 @post Transactions fail only on those "other system-wide error codes".
571 @capability Dependent Caller must satisfy the read policies of all settings found in the source range.
573 EXPORT_C TInt CRepository::FindEqL(TUint32 aPartialKey, TUint32 aMask,
574 TInt aValue, RArray<TUint32>& aFoundKeys)
576 TRAPD(ret,iImpl->FindSettingsComparisonL(aPartialKey,aMask,aValue,EEqual,aFoundKeys));
577 if (ret==KErrNoMemory)
578 User::LeaveNoMemory();
583 /** Finds all the settings that contain a given floating point value and match
584 the specification given by aPartialKey and aMask.
586 Contains a bit pattern that all the keys returned must at least partially
589 Has bits set for all the bits in aPartialKey that must match the returned
592 Settings for the keys found will be floating point values with value aValue.
593 @param aFoundKeys All the keys found.
594 For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and
595 the setting with key k is a floating point value aValue.
598 KErrNone if successful,
599 KErrNotFound if capability check passed but no matching items are found,
600 plus other system-wide error codes.
601 @post Transactions fail only on those "other system-wide error codes".
602 @capability Dependent Caller must satisfy the read policies of all settings found in the source range.
604 EXPORT_C TInt CRepository::FindEqL(TUint32 aPartialKey, TUint32 aMask,
605 const TReal& aValue, RArray<TUint32>& aFoundKeys)
607 TRAPD(ret,iImpl->FindSettingsComparisonL(aPartialKey,aMask,aValue,EEqual,aFoundKeys));
608 if (ret==KErrNoMemory)
609 User::LeaveNoMemory();
614 /** Finds all the settings that contain a given string value and match the
615 specification given by aPartialKey and aMask.
617 Contains a bit pattern that all the keys returned must at least partially
620 Has bits set for all the bits in aPartialKey that must match the returned
623 Settings for the keys found will be string values with value aValue.
624 @param aFoundKeys All the keys found.
625 For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and
626 the setting with key k is a string value aValue.
629 KErrNone if successful,
630 KErrNotFound if capability check passed but no matching items are found,
631 plus other system-wide error codes.
632 @post Transactions fail only on those "other system-wide error codes".
633 @capability Dependent Caller must satisfy the read policies of all settings found in the source range.
635 EXPORT_C TInt CRepository::FindEqL(TUint32 aPartialKey, TUint32 aMask,
636 const TDesC8& aValue, RArray<TUint32>& aFoundKeys)
638 TRAPD(ret,iImpl->FindSettingsComparisonL(aPartialKey,aMask,aValue,EEqual,aFoundKeys));
639 if (ret==KErrNoMemory)
640 User::LeaveNoMemory();
645 /** Finds all the settings that contain a given string value and match the
646 specification given by aPartialKey and aMask.
649 Contains a bit pattern that all the keys returned must at least partially
652 Has bits set for all the bits in aPartialKey that must match the returned
655 Settings for the keys found will be string values with value aValue.
656 @param aFoundKeys All the keys found.
657 For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and
658 the setting with key k is a string value aValue.
661 KErrNone if successful,
662 KErrNotFound if capability check passed but no matching items are found,
663 plus other system-wide error codes.
664 @post Transactions fail only on those "other system-wide error codes".
665 @capability Dependent Caller must satisfy the read policies of all settings found in the source range.
667 EXPORT_C TInt CRepository::FindEqL(TUint32 aPartialKey, TUint32 aMask,
668 const TDesC16& aValue, RArray<TUint32>& aFoundKeys)
670 TPtrC8 pVal((const TUint8*)aValue.Ptr(), aValue.Length()*2);
671 TRAPD(ret,iImpl->FindSettingsComparisonL(aPartialKey,aMask,pVal,EEqual,aFoundKeys));
672 if (ret==KErrNoMemory)
673 User::LeaveNoMemory();
678 /** Finds all the settings that match the specification given by aPartialKey
679 and aMask, but are either not integer values or do not have the given value.
681 Contains a bit pattern that all the keys returned must at least partially
684 Has bits set for all the bits in aPartialKey that must match the returned
687 Settings for the keys found will be settings that either contain values
688 that are not integers or integers other than aValue.
689 @param aFoundKeys All the keys found.
690 For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and
691 the setting with key k is either not an integer or an integer not equal to
695 KErrNone if successful,
696 KErrNotFound if capability check passed but no non-matching items are found,
697 plus other system-wide error codes.
698 @post Transactions fail only on those "other system-wide error codes".
699 @capability Dependent Caller must satisfy the read policies of all settings found in the source range.
701 EXPORT_C TInt CRepository::FindNeqL(TUint32 aPartialKey, TUint32 aMask,
702 TInt aValue, RArray<TUint32>& aFoundKeys)
704 TRAPD(ret,iImpl->FindSettingsComparisonL(aPartialKey,aMask,aValue,ENotEqual,aFoundKeys));
705 if (ret==KErrNoMemory)
706 User::LeaveNoMemory();
711 /** Finds all the settings that match the specification given by aPartialKey
712 and aMask, but are either not floating point values or do not have the given value.
714 Contains a bit pattern that all the keys returned must at least partially
717 Has bits set for all the bits in aPartialKey that must match the returned
720 Settings for the keys found will be settings that either contain values
721 that are not floating point or floating point values other than aValue.
722 @param aFoundKeys All the keys found.
723 For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and
724 the setting with key k is either not a floating point value or a floating
725 point value not equal to aValue.
728 KErrNone if successful,
729 KErrNotFound if capability check passed but no non-matching items are found,
730 plus other system-wide error codes.
731 @post Transactions fail only on those "other system-wide error codes".
732 @capability Dependent Caller must satisfy the read policies of all settings found in the source range.
734 EXPORT_C TInt CRepository::FindNeqL(TUint32 aPartialKey, TUint32 aMask,
735 const TReal& aValue, RArray<TUint32>& aFoundKeys)
737 TRAPD(ret,iImpl->FindSettingsComparisonL(aPartialKey,aMask,aValue,ENotEqual,aFoundKeys));
738 if (ret==KErrNoMemory)
739 User::LeaveNoMemory();
744 /** Finds all the settings that match the specification given by aPartialKey
745 and aMask, but are either not string values or do not match the given string.
747 Contains a bit pattern that all the keys returned must at least partially
750 Has bits set for all the bits in aPartialKey that must match the returned
753 Settings for the keys found will be settings that either contain values
754 that are not strings or strings with value other than aValue.
755 @param aFoundKeys All the keys found.
756 For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and
757 the setting with key k is either not a string value or a string value not
761 KErrNone if successful,
762 KErrNotFound if capability check passed but no non-matching items are found,
763 plus other system-wide error codes.
764 @post Transactions fail only on those "other system-wide error codes".
765 @capability Dependent Caller must satisfy the read policies of all settings found in the source range.
767 EXPORT_C TInt CRepository::FindNeqL(TUint32 aPartialKey, TUint32 aMask,
768 const TDesC8& aValue, RArray<TUint32>& aFoundKeys)
770 TRAPD(ret,iImpl->FindSettingsComparisonL(aPartialKey,aMask,aValue,ENotEqual,aFoundKeys));
771 if (ret==KErrNoMemory)
772 User::LeaveNoMemory();
776 /** Finds all the settings that match the specification given by aPartialKey
777 and aMask, but are either not string values or do not match the given string.
779 Contains a bit pattern that all the keys returned must at least partially
782 Has bits set for all the bits in aPartialKey that must match the returned
785 Settings for the keys found will be settings that either contain values
786 that are not strings or strings with value other than aValue.
787 @param aFoundKeys All the keys found.
788 For each key k in aFoundKeys, (k & aMask) == (aPartialKey & aMask) and
789 the setting with key k is either not a string value or a string value not
793 KErrNone if successful,
794 KErrNotFound if capability check passed but no non-matching items are found,
795 plus other system-wide error codes.
796 @post Transactions fail only on those "other system-wide error codes".
797 @capability Dependent Caller must satisfy the read policies of all settings found in the source range.
799 EXPORT_C TInt CRepository::FindNeqL(TUint32 aPartialKey, TUint32 aMask,
800 const TDesC16& aValue, RArray<TUint32>& aFoundKeys)
802 TPtrC8 pVal((const TUint8*)aValue.Ptr(), aValue.Length()*2);
803 TRAPD(ret,iImpl->FindSettingsComparisonL(aPartialKey,aMask,pVal,ENotEqual,aFoundKeys));
804 if (ret==KErrNoMemory)
805 User::LeaveNoMemory();
809 /** Attempts to starts a transaction in the given mode.
810 This function is doing nothing and just return KErrNone
811 @param aMode transaction mode: EConcurrentReadWriteTransaction (standard),
812 EReadTransaction or EReadWriteTransaction.
814 @see CRepository::TTransactionMode
816 EXPORT_C TInt CRepository::StartTransaction(TTransactionMode /**aMode*/)
822 /** Attempts to starts a transaction in the given mode asynchronously
823 This function does nothing
824 @param aMode transaction mode: EConcurrentReadWriteTransaction (standard),
825 EReadTransaction or EReadWriteTransaction.
826 @see CRepository::TTransactionMode
827 @param aStatus No effect on this parameter
829 EXPORT_C void CRepository::StartTransaction(TTransactionMode /**aMode*/, TRequestStatus& /**aStatus*/)
835 /** Commits a transaction.
836 This function does nothing and just return KErrNone
838 @param aKeyInfo no effect on this parameter
840 EXPORT_C TInt CRepository::CommitTransaction(TUint32& /**aKeyInfo*/)
846 /** Commits a transaction asynchronously
847 This function does nothing
849 A descriptor to receive a TUint32 value, e.g. TTransactionKeyInfoBuf, which
850 client must ensure remains in scope for the duration of the asynchronous request.
851 No effect on this input parameter
852 @see CRepository::TTransactionKeyInfoBuf
853 @param aStatus Completion status of asynchronous request:
854 No effect on this input parameter
856 EXPORT_C void CRepository::CommitTransaction(TDes8& /**aKeyInfo*/, TRequestStatus& /**aStatus*/)
862 /** Cancels the current transaction with rollback
863 This function does nothing
865 EXPORT_C void CRepository::CancelTransaction()
869 /** Sets the active transaction to a failed state
870 This function does nothing
872 EXPORT_C void CRepository::FailTransaction()
876 /** Pushes onto the CleanupStack a TCleanupItem that calls CancelTransaction if
877 activated by a Leave or PopAndDestroy.
878 This function does nothing
880 EXPORT_C void CRepository::CleanupCancelTransactionPushL()
882 CleanupStack::PushL(TCleanupItem(CPcRepImpl::FailTransactionCleanupOperation, this));
885 /** Pushes onto the CleanupStack a TCleanupItem that calls FailTransaction if
886 activated by a Leave or PopAndDestroy.
887 This function does nothing
889 EXPORT_C void CRepository::CleanupFailTransactionPushL()
891 CleanupStack::PushL(TCleanupItem(CPcRepImpl::FailTransactionCleanupOperation, this));