genericopenlibs/cstdlib/INC/REDIRSTR.H
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 //  Abstract stream classes for Stdio Redirection app
       
    17 //
       
    18 #ifndef _REDIRSTR_H_
       
    19 #define _REDIRSTR_H_
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <e32std.h>
       
    23 /**
       
    24 Maximum size of TBuf<> data member in the CStreamFactoryBase2 class.
       
    25 @see CStreamFactoryBase2
       
    26 @publishedPartner
       
    27 @released
       
    28 */
       
    29 const TInt KMaxStatusTextLength = 128;
       
    30 
       
    31 // The following functions are defined to replace previous exports so def file 
       
    32 // does not need reordering.
       
    33 IMPORT_C void DummyReserved9();
       
    34 IMPORT_C void DummyReserved10();
       
    35 IMPORT_C void DummyReserved11();
       
    36 	
       
    37 /**
       
    38 Abstract class that defines stream like objects.
       
    39 
       
    40 @publishedPartner
       
    41 @released
       
    42 */	
       
    43 class CStreamBase2 : public CBase
       
    44 	{
       
    45 public:
       
    46 	virtual void Write(TDes8& aDes) = 0;
       
    47 	virtual void Read(const RMessage2& aMessage) = 0;
       
    48 protected:	
       
    49 	TBuf8<256> iBuf; // buffer for holding stdin characters
       
    50 	IMPORT_C void CompleteRead(const RMessage2 &aMessage);
       
    51 	};
       
    52 
       
    53 /** 
       
    54 Abstract Factory class for creating stream-like classes.
       
    55 
       
    56 @publishedPartner
       
    57 @released
       
    58 */
       
    59 class CStreamFactoryBase2 : public CBase
       
    60 	{
       
    61 public:
       
    62 	virtual CStreamBase2* GetStream() = 0;
       
    63 	virtual void Configure() = 0;
       
    64 	IMPORT_C virtual const TDesC& GetStatus() const;
       
    65 protected:
       
    66 	IMPORT_C void AppendToStatus(const TDesC& aMsg);
       
    67 private:
       
    68 	TBuf<KMaxStatusTextLength> iStatusMsg;
       
    69 	};
       
    70 
       
    71 
       
    72 #endif