|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Stack to hold the data start and end markers |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CPENGPARSERSTACK_H |
|
19 #define CPENGPARSERSTACK_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 |
|
24 /** |
|
25 * Helper class to hold the parsing intervals in a stack |
|
26 * |
|
27 * @since 3.0 |
|
28 */ |
|
29 NONSHARABLE_CLASS( CPEngParserStack ): public CBase |
|
30 { |
|
31 public: // Constructors and destructor |
|
32 |
|
33 /** |
|
34 * Two-phased constructor. |
|
35 */ |
|
36 static CPEngParserStack* NewL(); |
|
37 |
|
38 /** |
|
39 * Destructor. |
|
40 */ |
|
41 virtual ~CPEngParserStack(); |
|
42 |
|
43 public: // New functions |
|
44 |
|
45 /** |
|
46 * Pushes an item marking the start of the data to the stack |
|
47 * @since 2.1 |
|
48 * @return Append return value KErrNone or some error |
|
49 * @param aItem Item to be pushed |
|
50 */ |
|
51 TInt PushStart( TUint aItem ); |
|
52 |
|
53 /** |
|
54 * Pushes an item marking the end of the data to the stack |
|
55 * @since 2.1 |
|
56 * @return Append return value KErrNone or some error |
|
57 * @param aItem Item to be pushed |
|
58 */ |
|
59 TInt PushEnd( TUint aItem ); |
|
60 |
|
61 /** |
|
62 * Pops both, the start marker and the end marker out of the stack. Both |
|
63 * is needed so the stack remains consistent. |
|
64 * @since 2.1 |
|
65 * @return TPoint A popped item |
|
66 */ |
|
67 TPoint Pop(); |
|
68 |
|
69 /** |
|
70 * Resets the stack. |
|
71 */ |
|
72 void Reset(); |
|
73 |
|
74 private: |
|
75 |
|
76 /** |
|
77 * Pops an item marking the start of the data to the stack |
|
78 * @since 2.1 |
|
79 * @return TUint A popped item |
|
80 */ |
|
81 TUint PopStart(); |
|
82 |
|
83 /** |
|
84 * Pops an item marking the end of the data to the stack |
|
85 * @since 2.1 |
|
86 * @return TUint A popped item |
|
87 */ |
|
88 TUint PopEnd(); |
|
89 |
|
90 private: |
|
91 |
|
92 /** |
|
93 * C++ default constructor. |
|
94 */ |
|
95 CPEngParserStack(); |
|
96 |
|
97 |
|
98 private: // Data |
|
99 // The array of start markers |
|
100 RArray<TUint> iStartArray; |
|
101 |
|
102 // The array of end markers |
|
103 RArray<TUint> iEndArray; |
|
104 }; |
|
105 |
|
106 #endif // CPENGPARSERSTACK_H |
|
107 |
|
108 // End of File |