os/ossrv/genericopenlibs/openenvcore/backend/inc/filestream.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        : filestream.h
    16 * Part of     : stdio server
    17 * To handle file read and write
    18 * File stream for Stdio Redirection app
    19 * 
    20 *
    21 */
    22 
    23 
    24 
    25 
    26 #ifndef _FILESTREAM_H_
    27 #define _FILESTREAM_H_
    28 
    29 #include "streambase.h"
    30 
    31 
    32 //-----------------------------------------------------------------------
    33 //Class name:  CFileStream 
    34 //Description: This class represents the File stream abstraction.
    35 // 			   It is created through the factory class CFileStreamFactory
    36 //-----------------------------------------------------------------------
    37 class CFileStream : public CStreamBase
    38 	{
    39 public:
    40 	static CFileStream* NewL(TDesC& aFileName, TBool aIsWrite);
    41 	~CFileStream();
    42  	virtual void WriteL(TDes8& aDes);
    43     virtual void Read(TRequestStatus& aStatus, const TInt aLength);
    44 	virtual void ReadCancel() {}
    45    	TStreamType Type() { return EFile;}
    46    	
    47 private:
    48 	void ConstructL(TDesC& aFileName);
    49 	CFileStream(TBool aIsWrite);
    50   	RFile iFile;
    51 	TInt iFileErr;
    52 	//if file is used for write.
    53 	TBool iIsWrite;
    54 	TFileName iFileName;
    55 	};
    56 
    57 
    58 #endif //_FILESTREAM_H_