sl@0: /* sl@0: * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Name : streambase.h sl@0: * Part of : stdio server sl@0: * base implementation for media types sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: #ifndef _STREAMBASE_H_ sl@0: #define _STREAMBASE_H_ sl@0: sl@0: #include //CBase sl@0: sl@0: sl@0: const TInt KMaxStatusTextLength = 128; sl@0: sl@0: enum TStreamType sl@0: { sl@0: EConsole =0, sl@0: EFile, sl@0: ESerial, sl@0: ENull sl@0: }; sl@0: sl@0: //----------------------------------------------------------------------- sl@0: //Class name: CStreamBase sl@0: //Description: Abstract class that defines stream like objects. sl@0: //----------------------------------------------------------------------- sl@0: class CStreamBase : public CBase sl@0: { sl@0: public: sl@0: virtual void WriteL(TDes8& aDes) = 0; sl@0: virtual void Read(TRequestStatus& aStatus, const TInt aLength) = 0; sl@0: virtual TDes8& Buf(); sl@0: virtual void ReadCancel() = 0; sl@0: virtual TStreamType Type() = 0; sl@0: virtual ~CStreamBase() sl@0: { sl@0: } sl@0: protected: sl@0: TBuf8<256> iBuf; // buffer for holding stdin characters sl@0: CStreamBase() sl@0: { sl@0: iBuf.Zero(); sl@0: } sl@0: }; sl@0: sl@0: #endif //_STREAMBASE_H_