|
1 // Copyright (c) 1997-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 __BYTELIST_H |
|
17 #define __BYTELIST_H |
|
18 |
|
19 #include <e32std.h> |
|
20 #include <s32stor.h> |
|
21 |
|
22 class CItem; |
|
23 |
|
24 // |
|
25 // class CByteList - First In, First Out temporary data storage for bytes |
|
26 // |
|
27 //##ModelId=3B6678E302BB |
|
28 class CByteList : public CBase |
|
29 { |
|
30 public: |
|
31 //##ModelId=3B6678E30385 |
|
32 static CByteList* NewL(); |
|
33 //##ModelId=3B6678E30384 |
|
34 static CByteList* NewLC(); |
|
35 //##ModelId=3B6678E3037C |
|
36 virtual ~CByteList(); |
|
37 |
|
38 //##ModelId=3B6678E3037A |
|
39 void AddToListL(HBufC8& aBuffer); |
|
40 //##ModelId=3B6678E30371 |
|
41 void Commit(); |
|
42 //##ModelId=3B6678E30370 |
|
43 void RollBack(); |
|
44 //##ModelId=3B6678E30366 |
|
45 TInt Byte(TUint8* aByte, TBool aIncrement); |
|
46 //##ModelId=3B6678E3035C |
|
47 TInt Inc(TInt aCount); |
|
48 |
|
49 private: |
|
50 //##ModelId=3B6678E3035B |
|
51 CByteList(); |
|
52 //##ModelId=3B6678E30352 |
|
53 void Construct(); |
|
54 |
|
55 private: |
|
56 //##ModelId=3B6678E30349 |
|
57 TSglQue<CItem> iList; |
|
58 //##ModelId=3B6678E30321 |
|
59 TSglQueIter<CItem> iListIter; |
|
60 //##ModelId=3B6678E3030D |
|
61 TSglQueIter<CItem> iListCommit; |
|
62 //##ModelId=3B6678E302E5 |
|
63 TInt iByteOffset; |
|
64 //##ModelId=3B6678E302DC |
|
65 TInt iByteCommit; |
|
66 }; |
|
67 |
|
68 // |
|
69 // class CItem - to be used with CByteList |
|
70 // |
|
71 //##ModelId=3B6678E40082 |
|
72 class CItem : public CBase |
|
73 { |
|
74 public: |
|
75 //##ModelId=3B6678E400D2 |
|
76 static CItem* NewL (const HBufC8& aData); |
|
77 //##ModelId=3B6678E400C9 |
|
78 static CItem* NewLC (const HBufC8& aData); |
|
79 //##ModelId=3B6678E400C1 |
|
80 void ConstructL (const HBufC8& aData); |
|
81 |
|
82 //##ModelId=3B6678E400C0 |
|
83 virtual ~CItem(); |
|
84 //##ModelId=3B6678E400BF |
|
85 HBufC8* Data() const; |
|
86 |
|
87 //##ModelId=3B6678E400B6 |
|
88 static const TInt iOffset; |
|
89 |
|
90 private: |
|
91 //##ModelId=3B6678E400BE |
|
92 CItem(); |
|
93 |
|
94 private: |
|
95 //##ModelId=3B6678E400AA |
|
96 TSglQueLink iLink; |
|
97 //##ModelId=3B6678E400A0 |
|
98 HBufC8* iData; |
|
99 friend class CList; |
|
100 }; |
|
101 |
|
102 #endif // __BYTELIST_H |
|
103 |
|
104 // |
|
105 // End of file |
|
106 // |