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