os/ossrv/genericopenlibs/openenvcore/backend/inc/streambase.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 * Name        : streambase.h
    16 * Part of     : stdio server
    17 * base implementation for media types
    18 *
    19 */
    20 
    21 
    22 
    23 
    24 #ifndef _STREAMBASE_H_
    25 #define _STREAMBASE_H_
    26 
    27 #include <e32base.h>//CBase
    28 
    29 
    30 const TInt KMaxStatusTextLength = 128;
    31 
    32 enum TStreamType
    33 	{
    34 	EConsole =0,
    35 	EFile,
    36 	ESerial,
    37 	ENull
    38 	};
    39 
    40 //-----------------------------------------------------------------------
    41 //Class name: CStreamBase
    42 //Description: Abstract class that defines stream like objects.
    43 //-----------------------------------------------------------------------
    44 class CStreamBase : public CBase
    45 	{
    46 public:
    47 	virtual void WriteL(TDes8& aDes) = 0;
    48 	virtual void Read(TRequestStatus& aStatus, const TInt aLength) = 0;
    49 	virtual TDes8& Buf();
    50  	virtual void ReadCancel() = 0;	
    51  	virtual TStreamType Type() = 0;
    52 	virtual ~CStreamBase()
    53 		{
    54 		}
    55 protected:
    56 	TBuf8<256> iBuf; 	// buffer for holding stdin characters
    57 	CStreamBase()
    58 		{
    59 		iBuf.Zero();
    60 		}
    61 	};
    62 
    63 #endif //_STREAMBASE_H_