sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
/**
|
sl@0
|
20 |
@test
|
sl@0
|
21 |
@internalComponent
|
sl@0
|
22 |
|
sl@0
|
23 |
This contains CT_FileData
|
sl@0
|
24 |
*/
|
sl@0
|
25 |
|
sl@0
|
26 |
#if (!defined __T_FILE_DATA_H__)
|
sl@0
|
27 |
#define __T_FILE_DATA_H__
|
sl@0
|
28 |
|
sl@0
|
29 |
// User Includes
|
sl@0
|
30 |
#include "DataWrapperBase.h"
|
sl@0
|
31 |
#include "T_FsData.h"
|
sl@0
|
32 |
#include "T_FileActiveCallback.h"
|
sl@0
|
33 |
|
sl@0
|
34 |
// EPOC includes
|
sl@0
|
35 |
#include <f32file.h>
|
sl@0
|
36 |
|
sl@0
|
37 |
class CT_FileData: public CDataWrapperBase
|
sl@0
|
38 |
{
|
sl@0
|
39 |
public:
|
sl@0
|
40 |
static CT_FileData* NewL();
|
sl@0
|
41 |
~CT_FileData();
|
sl@0
|
42 |
|
sl@0
|
43 |
virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
44 |
virtual TAny* GetObject();
|
sl@0
|
45 |
|
sl@0
|
46 |
protected:
|
sl@0
|
47 |
CT_FileData();
|
sl@0
|
48 |
void ConstructL();
|
sl@0
|
49 |
|
sl@0
|
50 |
private:
|
sl@0
|
51 |
// Commands
|
sl@0
|
52 |
void DoCmdNewL();
|
sl@0
|
53 |
void DoCmdDestructor();
|
sl@0
|
54 |
void DoCmdCreateL(const TDesC& aSection);
|
sl@0
|
55 |
void DoCmdOpenL(const TDesC& aSection);
|
sl@0
|
56 |
void DoCmdWriteL(const TDesC& aSection, const TInt aSyncErrorIndex);
|
sl@0
|
57 |
void DoCmdClose();
|
sl@0
|
58 |
void DoCmdReplaceL(const TDesC& aSection);
|
sl@0
|
59 |
void DoCmdReadL(const TDesC& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
60 |
void DoCmdFlushL(const TDesC& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
61 |
void DoCmdTempL(const TDesC& aSection);
|
sl@0
|
62 |
void DoCmdRenameL(const TDesC& aSection);
|
sl@0
|
63 |
void DoCmdSeekL(const TDesC& aSection);
|
sl@0
|
64 |
void DoCmdReadCancelL(const TDesC& aSection);
|
sl@0
|
65 |
void DoCmdLockL(const TDesC& aSection);
|
sl@0
|
66 |
void DoCmdUnLockL(const TDesC& aSection);
|
sl@0
|
67 |
void DoCmdSizeL(const TDesC& aSection);
|
sl@0
|
68 |
void DoCmdSetSizeL(const TDesC& aSection);
|
sl@0
|
69 |
void DoCmdAttL(const TDesC& aSection);
|
sl@0
|
70 |
void DoCmdSetAttL(const TDesC& aSection);
|
sl@0
|
71 |
void DoCmdModifiedL(const TDesC& aSection);
|
sl@0
|
72 |
void DoCmdSetModifiedL(const TDesC& aSection);
|
sl@0
|
73 |
void DoCmdSetL(const TDesC& aSection);
|
sl@0
|
74 |
void DoCmdChangeModeL(const TDesC& aSection);
|
sl@0
|
75 |
void DoCmdDriveL(const TDesC& aSection);
|
sl@0
|
76 |
void DoCmdBlockMap(const TDesC& aSection);
|
sl@0
|
77 |
void DoCmdDuplicateL(const TDesC& aSection);
|
sl@0
|
78 |
void DoCmdFullName(const TDesC& aSection);
|
sl@0
|
79 |
void DoCmdNameL(const TDesC& aSection);
|
sl@0
|
80 |
|
sl@0
|
81 |
|
sl@0
|
82 |
|
sl@0
|
83 |
// Helpers
|
sl@0
|
84 |
inline void DoCleanup();
|
sl@0
|
85 |
|
sl@0
|
86 |
TBool GetFileModeL(const TDesC& aParameterName, const TDesC& aSection, TUint& aFileMode);
|
sl@0
|
87 |
TBool ConvertToSeek(const TDesC& aParameterName, const TDesC& aSection, TSeek& aSeek);
|
sl@0
|
88 |
TBool ConvertToOwnerType(const TDesC& aParameterName, const TDesC& aSection, TOwnerType& aResult);
|
sl@0
|
89 |
TBool ConvertToAttributeL(const TDesC& aParameterName, const TDesC& aSection, TUint& aAttribute);
|
sl@0
|
90 |
TBool ConvertToBlockMapUsage(const TDesC& aParameterName, const TDesC& aSection, TBlockMapUsage& aResult);
|
sl@0
|
91 |
|
sl@0
|
92 |
void RunL(CActive* aActive, const TInt aIndex);
|
sl@0
|
93 |
void DoCancel(CActive* aActive, TInt aIndex);
|
sl@0
|
94 |
|
sl@0
|
95 |
void ReadCancelAll();
|
sl@0
|
96 |
void ReadCancel();
|
sl@0
|
97 |
void DoAsynchronousWritesL(const TDesC& aSection, const TInt aSyncErrorIndex);
|
sl@0
|
98 |
void DoSynchronousWritesL(const TDesC& aSection);
|
sl@0
|
99 |
void HandleExpectedString(const TDesC8& aReadedData, const TDesC& aSection);
|
sl@0
|
100 |
void HandleExpectedString(const TDesC& aReadedData, const TDesC& aSection);
|
sl@0
|
101 |
void DoSynchronousReadsL(const TDesC& aSection);
|
sl@0
|
102 |
void DoAsynchronousReadsL(const TDesC& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
103 |
|
sl@0
|
104 |
void PrintFileAttributes(TUint aAttValue);
|
sl@0
|
105 |
|
sl@0
|
106 |
void ToArrayL(RPointerArray<HBufC>& aArray, HBufC*& aBuffer);
|
sl@0
|
107 |
RPointerArray<HBufC> SplitL(const TDesC& aInput, const char* aToken);
|
sl@0
|
108 |
|
sl@0
|
109 |
|
sl@0
|
110 |
private:
|
sl@0
|
111 |
/** Instance for handling to resource file */
|
sl@0
|
112 |
RPointerArray<CT_FileActiveCallback> iReadCallbackArray;
|
sl@0
|
113 |
RPointerArray<CActiveCallback> iWriteCallbackArray;
|
sl@0
|
114 |
RPointerArray<CActiveCallback> iFlushCallbackArray;
|
sl@0
|
115 |
RFile* iFile;
|
sl@0
|
116 |
TBool iFileOpened;
|
sl@0
|
117 |
};
|
sl@0
|
118 |
|
sl@0
|
119 |
#endif /* __T_FILE_DATA_H__ */
|