|
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 the License "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 // f32\sfile\sf_ops.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include "sf_std.h" |
|
19 |
|
20 |
|
21 |
|
22 TBool TOperation::IsOpenSubSess() const |
|
23 // |
|
24 // If so need to allocate for both open and close as close sub session must happen |
|
25 // |
|
26 { |
|
27 switch(iFunction) |
|
28 { |
|
29 case EFsDirOpen: |
|
30 case EFsFileDuplicate: |
|
31 case EFsFileOpen: |
|
32 case EFsFileCreate: |
|
33 case EFsFileReplace: |
|
34 case EFsFileTemp: |
|
35 case EFsFormatOpen: |
|
36 case EFsRawDiskOpen: |
|
37 case EFsPluginOpen: |
|
38 #ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION |
|
39 case EFsNotificationOpen: |
|
40 #endif //SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION |
|
41 return ETrue; |
|
42 default: |
|
43 return EFalse; |
|
44 } |
|
45 } |
|
46 |
|
47 TBool TOperation::IsCloseSubSess() const |
|
48 // |
|
49 // If so need to close sub session |
|
50 // |
|
51 { |
|
52 switch (iFunction) |
|
53 { |
|
54 case EFsFileSubClose: |
|
55 case EFsFormatSubClose: |
|
56 case EFsDirSubClose: |
|
57 case EFsRawSubClose: |
|
58 case EFsPluginSubClose: |
|
59 #ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION |
|
60 case EFsNotificationSubClose: |
|
61 #endif //SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION |
|
62 return ETrue; |
|
63 default: |
|
64 return EFalse; |
|
65 } |
|
66 } |
|
67 |
|
68 |
|
69 TBool TOperation::IsChangeNotify() const |
|
70 // |
|
71 // |
|
72 // |
|
73 { |
|
74 switch(iFunction) |
|
75 { |
|
76 case EFsFileCreate: |
|
77 case EFsFileReplace: |
|
78 case EFsDelete: |
|
79 case EFsReplace: |
|
80 case EFsFileRename: |
|
81 case EFsMkDir: |
|
82 case EFsRmDir: |
|
83 case EFsRename: |
|
84 case EFsSetVolume: |
|
85 case EFsFileSet: |
|
86 case EFsFileSetAtt: |
|
87 case EFsFileSetModified: |
|
88 case EFsFileSetSize: |
|
89 case EFsSetEntry: |
|
90 case EFsFileWrite: |
|
91 case EFsFileWriteDirty: |
|
92 case EFsRawDiskWrite: |
|
93 case EFsFileTemp: |
|
94 case EFsSetDriveName: |
|
95 case EFsLockDrive: |
|
96 case EFsUnlockDrive: |
|
97 return ETrue; |
|
98 default: |
|
99 return EFalse; |
|
100 } |
|
101 } |
|
102 |
|
103 TBool TOperation::IsDiskSpaceNotify() const |
|
104 // |
|
105 // |
|
106 // |
|
107 { |
|
108 switch(iFunction) |
|
109 { |
|
110 case EFsSetVolume: |
|
111 case EFsMkDir: |
|
112 case EFsRmDir: |
|
113 case EFsDelete: |
|
114 case EFsRename: |
|
115 case EFsReplace: |
|
116 case EFsFileCreate: |
|
117 case EFsFileReplace: |
|
118 case EFsFileTemp: |
|
119 case EFsFileWrite: |
|
120 case EFsFileWriteDirty: |
|
121 case EFsFileFlush: |
|
122 case EFsFileSetSize: |
|
123 case EFsFileRename: |
|
124 case EFsReserveDriveSpace: |
|
125 case EFsFileSubClose: |
|
126 return ETrue; |
|
127 default: |
|
128 return EFalse; |
|
129 } |
|
130 } |
|
131 |
|
132 TBool TOperation::IsWrite() const |
|
133 // |
|
134 // return true if operation may cause write to media |
|
135 // |
|
136 { |
|
137 switch(iFunction) |
|
138 { |
|
139 case EFsSetVolume: |
|
140 case EFsMkDir: |
|
141 case EFsRmDir: |
|
142 case EFsDelete: |
|
143 case EFsRename: |
|
144 case EFsReplace: |
|
145 case EFsSetEntry: |
|
146 case EFsFileCreate: |
|
147 case EFsFileReplace: |
|
148 case EFsFileTemp: |
|
149 case EFsFileWrite: |
|
150 case EFsFileWriteDirty: |
|
151 case EFsFileSetSize: |
|
152 case EFsFileSetAtt: |
|
153 case EFsFileSetModified: |
|
154 case EFsFileSet: |
|
155 case EFsFileRename: |
|
156 case EFsFormatOpen: |
|
157 case EFsFormatNext: |
|
158 case EFsRawDiskWrite: |
|
159 case EFsScanDrive: |
|
160 case EFsLockDrive: |
|
161 case EFsUnlockDrive: |
|
162 return ETrue; |
|
163 default: |
|
164 return EFalse; |
|
165 } |
|
166 } |
|
167 |
|
168 TUint TOperation::NotifyType() const |
|
169 // |
|
170 // Convert operation that caused the notification to a |
|
171 // value corresponding to the correct TNotifyType enum |
|
172 // |
|
173 { |
|
174 switch (iFunction) |
|
175 { |
|
176 case EFsFileCreate: |
|
177 case EFsFileReplace: |
|
178 case EFsDelete: |
|
179 case EFsReplace: |
|
180 case EFsFileRename: |
|
181 return(ENotifyFile|ENotifyEntry); |
|
182 case EFsMkDir: |
|
183 case EFsRmDir: |
|
184 return(ENotifyDir|ENotifyEntry); |
|
185 case EFsRename: |
|
186 return(ENotifyDir|ENotifyFile|ENotifyEntry); |
|
187 case EFsSetVolume: |
|
188 return(ENotifyDisk|ENotifyEntry); |
|
189 case EFsFileSet: |
|
190 case EFsFileSetAtt: |
|
191 case EFsFileSetModified: |
|
192 case EFsFileSetSize: |
|
193 case EFsSetEntry: |
|
194 return(ENotifyAttributes); |
|
195 case EFsFileWrite: |
|
196 case EFsFileWriteDirty: |
|
197 return(ENotifyWrite); |
|
198 case EFsRawDiskWrite: |
|
199 case EFsLockDrive: |
|
200 case EFsUnlockDrive: |
|
201 return(ENotifyDisk); |
|
202 case EFsFileTemp: |
|
203 case EFsSetDriveName: |
|
204 return(ENotifyAll); |
|
205 default: |
|
206 return(0); |
|
207 } |
|
208 } |
|
209 |
|
210 TBool TOperation::IsCompleted() const |
|
211 // |
|
212 // |
|
213 // |
|
214 { |
|
215 switch(iFunction) |
|
216 { |
|
217 case EFsNotifyChange: |
|
218 case EFsNotifyChangeEx: |
|
219 #ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION |
|
220 case EFsNotificationBuffer: |
|
221 case EFsNotificationRequest: |
|
222 #endif //SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION |
|
223 case EFsNotifyDiskSpace: |
|
224 case EFsNotifyDismount: |
|
225 case EFsStartupInitComplete: |
|
226 case EFsResourceCountMarkEnd: |
|
227 case EFsPluginDoRequest: |
|
228 case EFsFileWriteDirty: |
|
229 return(EFalse); |
|
230 default: |
|
231 return(ETrue); |
|
232 } |
|
233 } |