0
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef __TrkTcbSrvSessionEngine_h__
|
|
19 |
#define __TrkTcbSrvSessionEngine_h__
|
|
20 |
|
|
21 |
// System includes
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <f32file.h>
|
|
24 |
|
|
25 |
// User includes
|
|
26 |
#include "TrkTcbCmdCodes.h"
|
|
27 |
|
|
28 |
// Classes referenced
|
|
29 |
|
|
30 |
|
|
31 |
//
|
|
32 |
// CTrkTcbSrvSessionEngine (header)
|
|
33 |
//
|
|
34 |
//
|
|
35 |
// The underlying engine used by each session. Manipulates the server-side objects.
|
|
36 |
//
|
|
37 |
class CTrkTcbSrvSessionEngine : public CBase
|
|
38 |
{
|
|
39 |
//Static construct and destruct
|
|
40 |
public:
|
|
41 |
static CTrkTcbSrvSessionEngine* NewL();
|
|
42 |
~CTrkTcbSrvSessionEngine();
|
|
43 |
|
|
44 |
//private construct
|
|
45 |
private:
|
|
46 |
CTrkTcbSrvSessionEngine();
|
|
47 |
void ConstructL();
|
|
48 |
|
|
49 |
//methods implementing the server cmds functionality
|
|
50 |
public:
|
|
51 |
void OpenFileL(const TDesC& aFilePath, TUint aMode, TTime& aModifiedTime);
|
|
52 |
void ReadFileL(TDes8& aFileData);
|
|
53 |
void WriteFileL(const TDesC8& aFileData);
|
|
54 |
void CloseFileL(const TTime& aModifiedTime);
|
|
55 |
void PositionFileL(TSeek aSeek, TInt& aOffset);
|
|
56 |
|
|
57 |
//date members
|
|
58 |
private:
|
|
59 |
enum TFileState
|
|
60 |
{
|
|
61 |
EFileOpened = 0,
|
|
62 |
EFileReading = 1,
|
|
63 |
EFileWriting = 2,
|
|
64 |
EFileClosed = 3,
|
|
65 |
EFileUnknown = -1
|
|
66 |
};
|
|
67 |
RFile iFile;
|
|
68 |
RFs iFs;
|
|
69 |
TFileState iFileState;
|
|
70 |
TUint iMode;
|
|
71 |
|
|
72 |
};
|
|
73 |
|
|
74 |
#endif
|