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 : filestream.h sl@0: * Part of : stdio server sl@0: * To handle file read and write sl@0: * File stream for Stdio Redirection app sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: #ifndef _FILESTREAM_H_ sl@0: #define _FILESTREAM_H_ sl@0: sl@0: #include "streambase.h" sl@0: sl@0: sl@0: //----------------------------------------------------------------------- sl@0: //Class name: CFileStream sl@0: //Description: This class represents the File stream abstraction. sl@0: // It is created through the factory class CFileStreamFactory sl@0: //----------------------------------------------------------------------- sl@0: class CFileStream : public CStreamBase sl@0: { sl@0: public: sl@0: static CFileStream* NewL(TDesC& aFileName, TBool aIsWrite); sl@0: ~CFileStream(); sl@0: virtual void WriteL(TDes8& aDes); sl@0: virtual void Read(TRequestStatus& aStatus, const TInt aLength); sl@0: virtual void ReadCancel() {} sl@0: TStreamType Type() { return EFile;} sl@0: sl@0: private: sl@0: void ConstructL(TDesC& aFileName); sl@0: CFileStream(TBool aIsWrite); sl@0: RFile iFile; sl@0: TInt iFileErr; sl@0: //if file is used for write. sl@0: TBool iIsWrite; sl@0: TFileName iFileName; sl@0: }; sl@0: sl@0: sl@0: #endif //_FILESTREAM_H_