|
1 // Copyright (c) 2004-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __S32FILEITER_H__ |
|
17 #define __S32FILEITER_H__ |
|
18 |
|
19 #ifndef __S32STD_H__ |
|
20 #include <s32std.h> |
|
21 #endif |
|
22 |
|
23 //Forward declarations |
|
24 class CPermanentFileStore; |
|
25 class RPermanentStoreTocIter; |
|
26 |
|
27 /** |
|
28 This class describes an object that can serve as a stream ID forward iterator |
|
29 for the controlled sequence of stream IDs in CPermanentFileStore instance. |
|
30 RPermanentFileStoreIter instances will allow you to access only stream IDs which are |
|
31 already commited to the store. |
|
32 |
|
33 Usage pattern: |
|
34 @code |
|
35 CPermanentFileStore* store; |
|
36 //create "store" ... |
|
37 RPermanentFileStoreIter iter; |
|
38 iter.ResetLC(*store); |
|
39 TStreamId id; |
|
40 while((id = iter.NextL()) != KNullStreamIdValue) |
|
41 { |
|
42 RStoreReadStream in; |
|
43 in.OpenLC(*store, id); |
|
44 //read from "in" stream |
|
45 CleanupStack::PopAndDestroy(&in); |
|
46 } |
|
47 CleanupStack::PopAndDestroy(&iter); |
|
48 @endcode |
|
49 |
|
50 Any change (deleting/adding streams) of stream IDs sequence during the lifetime of |
|
51 RPermanentFileStoreIter instance will invalidate it. |
|
52 |
|
53 @internalTechnology |
|
54 @released |
|
55 @see CPermanentFileStore |
|
56 @see TStreamId |
|
57 */ |
|
58 class RPermanentFileStoreIter |
|
59 { |
|
60 |
|
61 public: |
|
62 inline RPermanentFileStoreIter(); |
|
63 IMPORT_C void Close(); |
|
64 IMPORT_C void ResetLC(const CPermanentFileStore& aStore); |
|
65 inline void ResetL(const CPermanentFileStore& aStore); |
|
66 IMPORT_C TStreamId NextL(); |
|
67 |
|
68 private: |
|
69 RPermanentStoreTocIter* iImpl; |
|
70 |
|
71 }; |
|
72 |
|
73 #include <s32fileiter.inl> |
|
74 |
|
75 #endif//__S32FILEITER_H__ |