|
1 // Copyright (c) 2002-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 // $Header$ |
|
15 // This module implements the collection of stadard command classes for the |
|
16 // tester framework. |
|
17 // rev: mjdavey, symbian@mjdss.com, July 2002 |
|
18 // for: Typhoon (7.0s) & JetStream (8.0) |
|
19 // Include Files |
|
20 // |
|
21 // |
|
22 |
|
23 #include <e32std.h> // |
|
24 |
|
25 //----------------------------------------------------------------------------- |
|
26 // Include Definition Files |
|
27 |
|
28 #include "CIFControl.h" |
|
29 |
|
30 //----------------------------------------------------------------------------- |
|
31 //----------------------------------------------------------------------------- |
|
32 // Command: LOGFILE command. |
|
33 //----------------------------------------------------------------------------- |
|
34 //----------------------------------------------------------------------------- |
|
35 |
|
36 CIFControl *CIFControl::NewL() |
|
37 { |
|
38 CIFControl *self = NewLC(); |
|
39 CleanupStack::Pop(); |
|
40 return self; |
|
41 } |
|
42 |
|
43 //----------------------------------------------------------------------------- |
|
44 |
|
45 CIFControl *CIFControl::NewLC() |
|
46 { |
|
47 CIFControl *self = new (ELeave) CIFControl(); |
|
48 CleanupStack::PushL(self); |
|
49 self->ConstructL(ENotIf, EFalse, EIgnoreIF); |
|
50 return self; |
|
51 } |
|
52 |
|
53 //----------------------------------------------------------------------------- |
|
54 |
|
55 CIFControl *CIFControl::NewL (const CIFControl::TIFMode &aMode, |
|
56 const TBool &aStatus, |
|
57 const CIFControl::TIFProcessing &aProcess) |
|
58 { |
|
59 CIFControl *self = NewLC(aMode, aStatus, aProcess); |
|
60 CleanupStack::Pop(); |
|
61 return self; |
|
62 } |
|
63 |
|
64 //----------------------------------------------------------------------------- |
|
65 |
|
66 CIFControl *CIFControl::NewLC(const CIFControl::TIFMode &aMode, |
|
67 const TBool &aStatus, |
|
68 const CIFControl::TIFProcessing &aProcess) |
|
69 { |
|
70 CIFControl *self = new (ELeave) CIFControl(); |
|
71 CleanupStack::PushL(self); |
|
72 self->ConstructL(aMode, aStatus, aProcess); |
|
73 return self; |
|
74 } |
|
75 |
|
76 //----------------------------------------------------------------------------- |
|
77 |
|
78 void CIFControl::ConstructL(const CIFControl::TIFMode &aMode, |
|
79 const TBool &aStatus, |
|
80 const CIFControl::TIFProcessing &aProcess) |
|
81 { |
|
82 SetIFState(aProcess); |
|
83 SetIFMode(aMode); |
|
84 iIfResult = aStatus; |
|
85 |
|
86 //iIfMode = aMode; |
|
87 //iIfStatus = aProcess; |
|
88 |
|
89 iInIF = EFalse; |
|
90 iIfs = 0; |
|
91 iElses = 0; |
|
92 } |
|
93 |
|
94 //----------------------------------------------------------------------------- |
|
95 |
|
96 CIFControl::~CIFControl() |
|
97 { |
|
98 } |
|
99 |
|
100 //----------------------------------------------------------------------------- |
|
101 |
|
102 CIFControl::TIFMode CIFControl::GetIFMode() const |
|
103 { |
|
104 return iIfMode; |
|
105 } |
|
106 |
|
107 //----------------------------------------------------------------------------- |
|
108 |
|
109 void CIFControl::SetIFMode(const TIFMode &eMode)//, const TBool &aResult) |
|
110 { |
|
111 iIfMode = eMode; |
|
112 //iIfResult = aResult; |
|
113 } |
|
114 |
|
115 //----------------------------------------------------------------------------- |
|
116 |
|
117 CIFControl::TIFProcessing CIFControl::GetIFState() const |
|
118 { |
|
119 return iIfStatus; |
|
120 } |
|
121 |
|
122 //----------------------------------------------------------------------------- |
|
123 |
|
124 void CIFControl::SetIFState(const TIFProcessing &eProc) |
|
125 { |
|
126 iIfStatus = eProc; |
|
127 } |
|
128 |
|
129 //----------------------------------------------------------------------------- |
|
130 |
|
131 TBool CIFControl::GetIFResult() |
|
132 { |
|
133 return iIfResult; |
|
134 } |
|
135 |
|
136 //----------------------------------------------------------------------------- |
|
137 |
|
138 TInt CIFControl::GetIfCount() |
|
139 { |
|
140 return iIfs; |
|
141 } |
|
142 |
|
143 //----------------------------------------------------------------------------- |
|
144 |
|
145 TInt CIFControl::GetElseCount() |
|
146 { |
|
147 return iElses; |
|
148 } |
|
149 |
|
150 //----------------------------------------------------------------------------- |
|
151 |
|
152 void CIFControl::If(void) |
|
153 { |
|
154 ++iIfs; |
|
155 } |
|
156 |
|
157 //----------------------------------------------------------------------------- |
|
158 |
|
159 void CIFControl::Else(void) |
|
160 { |
|
161 ++iElses; |
|
162 } |
|
163 |
|
164 //----------------------------------------------------------------------------- |
|
165 |
|
166 void CIFControl::EndIf(void) |
|
167 { |
|
168 --iIfs; |
|
169 --iElses; |
|
170 } |
|
171 |
|
172 //----------------------------------------------------------------------------- |
|
173 // End of File |
|
174 //----------------------------------------------------------------------------- |