|
gnFileSource.hGo to the documentation of this file.00001 00002 // File: gnFileSource.h 00003 // Purpose: Implements gnBaseSource for .File files 00004 // Description: 00005 // Changes: 00006 // Version: libGenome 0.1.0 00007 // Author: Aaron Darling 00008 // Last Edited: April 15, 2001, 10:34:50pm 00009 // Modified by: 00010 // Copyright: (c) Aaron Darling 00011 // Licenses: Proprietary 00013 #ifndef _gnFileSource_h_ 00014 #define _gnFileSource_h_ 00015 00016 #include "gn/gnDefs.h" 00017 00018 #include <string> 00019 #include <fstream> 00020 #include "gn/gnBaseSource.h" 00021 #include "gn/gnFileContig.h" 00022 #include "gn/gnException.h" 00023 00028 class GNDLLEXPORT gnFileSource : public gnBaseSource 00029 { 00030 public: 00031 gnFileSource(){} 00032 gnFileSource(const gnFileSource& gnfs); 00033 virtual ~gnFileSource(){} 00034 virtual gnFileSource* Clone() const = 0; 00035 // Open, Close 00036 virtual void Open( string openString ); 00037 virtual void Open(); 00038 virtual void Close(); 00039 virtual string GetOpenString() const ; 00040 // Filter 00041 virtual const gnFilter* GetFilter() const ; 00042 virtual void SetFilter( gnFilter* filter ); 00043 00044 virtual boolean Read( const uint64 pos, char* buf, uint32& bufLen ); 00049 virtual gnFileContig* GetFileContig( const uint32 contigI ) const = 0; 00050 protected: 00051 string m_openString; 00052 ifstream m_ifstream; 00053 const gnFilter* m_pFilter; 00054 gnNewlineType m_newlineType; 00055 uint32 m_newlineSize; 00056 private: 00057 virtual boolean ParseStream( istream& fin ) = 0; 00058 };// class gnFileSource 00059 00060 inline 00061 string gnFileSource::GetOpenString( ) const 00062 { 00063 return m_openString; 00064 } 00065 // Filter 00066 inline 00067 const gnFilter* gnFileSource::GetFilter() const 00068 { 00069 return m_pFilter; 00070 } 00071 00072 inline 00073 void gnFileSource::SetFilter( gnFilter* filter ) 00074 { 00075 if(filter == NULL){ 00076 Throw_gnEx(NullPointer()); 00077 } 00078 m_pFilter = filter; 00079 } 00080 00081 #endif 00082 // _gnFileSource_h_ Generated at Fri Nov 30 15:36:51 2001 for libGenome by 1.2.8.1 written by Dimitri van Heesch, © 1997-2001 |