sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2006-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 |
* Name : stdiosesion.h
|
sl@0
|
16 |
* Part of : stdio server
|
sl@0
|
17 |
* To implement the stdio session
|
sl@0
|
18 |
*
|
sl@0
|
19 |
*
|
sl@0
|
20 |
*/
|
sl@0
|
21 |
|
sl@0
|
22 |
|
sl@0
|
23 |
|
sl@0
|
24 |
|
sl@0
|
25 |
#ifndef __STDIOSESSION_H__
|
sl@0
|
26 |
#define __STDIOSESSION_H__
|
sl@0
|
27 |
|
sl@0
|
28 |
|
sl@0
|
29 |
#include "inidata.h" //CIniData
|
sl@0
|
30 |
#include "StdioServer.h" //CStdioServer
|
sl@0
|
31 |
#include "streambase.h" //CStreamBase2
|
sl@0
|
32 |
#include "ReadRequestHandler.h"
|
sl@0
|
33 |
|
sl@0
|
34 |
|
sl@0
|
35 |
//ini file path and name
|
sl@0
|
36 |
_LIT(KFileName, "\\system\\data\\config.ini");
|
sl@0
|
37 |
|
sl@0
|
38 |
class CStreamFactoryBase;
|
sl@0
|
39 |
|
sl@0
|
40 |
|
sl@0
|
41 |
//-----------------------------------------------------------------------
|
sl@0
|
42 |
//Class name: CStdioSession
|
sl@0
|
43 |
//Description: Implement a session for the stdio redirection server.
|
sl@0
|
44 |
// This class contains the handle stream class for a
|
sl@0
|
45 |
// particular media type. The type of media is read from the
|
sl@0
|
46 |
// config.ini file.
|
sl@0
|
47 |
//-----------------------------------------------------------------------
|
sl@0
|
48 |
|
sl@0
|
49 |
class CStdioSession : public CSession2
|
sl@0
|
50 |
{
|
sl@0
|
51 |
public:
|
sl@0
|
52 |
static CSession2* NewL();
|
sl@0
|
53 |
void ServiceL(const RMessage2&);
|
sl@0
|
54 |
virtual void CreateL();
|
sl@0
|
55 |
~CStdioSession();
|
sl@0
|
56 |
|
sl@0
|
57 |
private:
|
sl@0
|
58 |
CStdioSession()
|
sl@0
|
59 |
{
|
sl@0
|
60 |
// nada
|
sl@0
|
61 |
}
|
sl@0
|
62 |
|
sl@0
|
63 |
void ReadIniL(CIniData* aIniData,TPtrC& aMedia,
|
sl@0
|
64 |
CStreamBase*& aStream,TBool aIsWrite);
|
sl@0
|
65 |
void ConstructL();
|
sl@0
|
66 |
CStdioServer& Server();
|
sl@0
|
67 |
TInt WriteStream(const RMessage2& aMessage);
|
sl@0
|
68 |
CStreamBase* iStreamRead;
|
sl@0
|
69 |
CStreamBase* iStreamWrite;
|
sl@0
|
70 |
CIniData* iIniData;
|
sl@0
|
71 |
CReadRequestHandler* iReadRequestHandler;
|
sl@0
|
72 |
TBuf8<256> iErrInBuf;
|
sl@0
|
73 |
TBuf8<256> iErrOutBuf;
|
sl@0
|
74 |
TBool iIsInputConsole;
|
sl@0
|
75 |
TBool iIsInMediaFile;
|
sl@0
|
76 |
};
|
sl@0
|
77 |
|
sl@0
|
78 |
|
sl@0
|
79 |
#endif //__STDIOSESSION_H__
|