os/ossrv/genericopenlibs/cstdlib/INC/REDIRSTR.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/INC/REDIRSTR.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,72 @@
     1.4 +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +//  Abstract stream classes for Stdio Redirection app
    1.20 +//
    1.21 +#ifndef _REDIRSTR_H_
    1.22 +#define _REDIRSTR_H_
    1.23 +
    1.24 +#include <e32base.h>
    1.25 +#include <e32std.h>
    1.26 +/**
    1.27 +Maximum size of TBuf<> data member in the CStreamFactoryBase2 class.
    1.28 +@see CStreamFactoryBase2
    1.29 +@publishedPartner
    1.30 +@released
    1.31 +*/
    1.32 +const TInt KMaxStatusTextLength = 128;
    1.33 +
    1.34 +// The following functions are defined to replace previous exports so def file 
    1.35 +// does not need reordering.
    1.36 +IMPORT_C void DummyReserved9();
    1.37 +IMPORT_C void DummyReserved10();
    1.38 +IMPORT_C void DummyReserved11();
    1.39 +	
    1.40 +/**
    1.41 +Abstract class that defines stream like objects.
    1.42 +
    1.43 +@publishedPartner
    1.44 +@released
    1.45 +*/	
    1.46 +class CStreamBase2 : public CBase
    1.47 +	{
    1.48 +public:
    1.49 +	virtual void Write(TDes8& aDes) = 0;
    1.50 +	virtual void Read(const RMessage2& aMessage) = 0;
    1.51 +protected:	
    1.52 +	TBuf8<256> iBuf; // buffer for holding stdin characters
    1.53 +	IMPORT_C void CompleteRead(const RMessage2 &aMessage);
    1.54 +	};
    1.55 +
    1.56 +/** 
    1.57 +Abstract Factory class for creating stream-like classes.
    1.58 +
    1.59 +@publishedPartner
    1.60 +@released
    1.61 +*/
    1.62 +class CStreamFactoryBase2 : public CBase
    1.63 +	{
    1.64 +public:
    1.65 +	virtual CStreamBase2* GetStream() = 0;
    1.66 +	virtual void Configure() = 0;
    1.67 +	IMPORT_C virtual const TDesC& GetStatus() const;
    1.68 +protected:
    1.69 +	IMPORT_C void AppendToStatus(const TDesC& aMsg);
    1.70 +private:
    1.71 +	TBuf<KMaxStatusTextLength> iStatusMsg;
    1.72 +	};
    1.73 +
    1.74 +
    1.75 +#endif