author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 2 |
// All rights reserved. |
williamr@2 | 3 |
// This component and the accompanying materials are made available |
williamr@2 | 4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
williamr@2 | 5 |
// which accompanies this distribution, and is available |
williamr@2 | 6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
williamr@2 | 7 |
// |
williamr@2 | 8 |
// Initial Contributors: |
williamr@2 | 9 |
// Nokia Corporation - initial contribution. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// Contributors: |
williamr@2 | 12 |
// |
williamr@2 | 13 |
// Description: |
williamr@2 | 14 |
// EPOC Server for redirecting stdin/stdout/stderr to a stream-like object |
williamr@2 | 15 |
// (console, file or serial port) |
williamr@2 | 16 |
// |
williamr@2 | 17 |
// |
williamr@2 | 18 |
|
williamr@2 | 19 |
#ifndef _REDIRCLI_H_ |
williamr@2 | 20 |
#define _REDIRCLI_H_ |
williamr@2 | 21 |
|
williamr@2 | 22 |
#include <e32std.h> |
williamr@2 | 23 |
#include <e32base.h> |
williamr@2 | 24 |
#include <redirstr.h> |
williamr@2 | 25 |
|
williamr@2 | 26 |
// The following functions are defined to replace previous exports so def file |
williamr@2 | 27 |
// does not need reordering. |
williamr@2 | 28 |
IMPORT_C void DummyReserved1(); |
williamr@2 | 29 |
IMPORT_C void DummyReserved2(); |
williamr@2 | 30 |
IMPORT_C void DummyReserved3(); |
williamr@2 | 31 |
IMPORT_C void DummyReserved4(); |
williamr@2 | 32 |
IMPORT_C void DummyReserved5(); |
williamr@2 | 33 |
IMPORT_C void DummyReserved6(); |
williamr@2 | 34 |
IMPORT_C void DummyReserved7(); |
williamr@2 | 35 |
IMPORT_C void DummyReserved8(); |
williamr@2 | 36 |
|
williamr@2 | 37 |
class CStreamFactoryBase2; |
williamr@2 | 38 |
class CStreamBase2; |
williamr@2 | 39 |
|
williamr@2 | 40 |
/** |
williamr@2 | 41 |
Redirection server class. |
williamr@2 | 42 |
|
williamr@2 | 43 |
This class represents the Redir server itself. It is created through the |
williamr@2 | 44 |
factory function NewL. It is not intended for user derivation. |
williamr@2 | 45 |
|
williamr@2 | 46 |
@publishedPartner |
williamr@2 | 47 |
@released |
williamr@2 | 48 |
*/ |
williamr@2 | 49 |
class CRedirServer2 : public CServer2 |
williamr@2 | 50 |
{ |
williamr@2 | 51 |
private: |
williamr@2 | 52 |
/**Priority flag |
williamr@2 | 53 |
*/ |
williamr@2 | 54 |
enum { |
williamr@2 | 55 |
//mpt - need to explain the magic here! |
williamr@2 | 56 |
EPriority=950 |
williamr@2 | 57 |
}; |
williamr@2 | 58 |
public: |
williamr@2 | 59 |
IMPORT_C static CRedirServer2* NewL(CStreamFactoryBase2* aStreamFactory); |
williamr@2 | 60 |
IMPORT_C void SetStreamFactory(CStreamFactoryBase2* aStreamFactory); |
williamr@2 | 61 |
virtual ~CRedirServer2(); |
williamr@2 | 62 |
private: |
williamr@2 | 63 |
CRedirServer2(CStreamFactoryBase2* aStreamFactory); |
williamr@2 | 64 |
virtual CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const; |
williamr@2 | 65 |
private: |
williamr@2 | 66 |
CStreamFactoryBase2* iStreamFactory; |
williamr@2 | 67 |
}; |
williamr@2 | 68 |
|
williamr@2 | 69 |
/** |
williamr@2 | 70 |
Client side session for Redirection server |
williamr@2 | 71 |
|
williamr@2 | 72 |
@internalAll |
williamr@2 | 73 |
*/ |
williamr@2 | 74 |
class RRedirSession2 : public RSessionBase |
williamr@2 | 75 |
{ |
williamr@2 | 76 |
public: |
williamr@2 | 77 |
IMPORT_C TInt Connect(); |
williamr@2 | 78 |
IMPORT_C void Read(TRequestStatus& aStatus, TDes8& aDes); |
williamr@2 | 79 |
IMPORT_C void Read(TRequestStatus& aStatus, TDes8& aDes, TInt aLength); |
williamr@2 | 80 |
IMPORT_C void Write(TRequestStatus& aStatus, const TDesC8& aDes); |
williamr@2 | 81 |
IMPORT_C void Write(TRequestStatus& aStatus, const TDesC8& aDes, TInt aLength); |
williamr@2 | 82 |
IMPORT_C void Flush(TRequestStatus& aStatus); |
williamr@2 | 83 |
private: |
williamr@2 | 84 |
//TO DO: do we really need this function?? |
williamr@2 | 85 |
TInt CheckEOF(TRequestStatus& aStatus); |
williamr@2 | 86 |
}; |
williamr@2 | 87 |
|
williamr@2 | 88 |
|
williamr@2 | 89 |
#endif |