Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skInputSource.h

00001 /*
00002   copyright 1996-2003
00003   Simon Whiteside
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019   $Id: skInputSource_8h-source.html,v 1.1 2003/04/14 15:56:13 simkin_cvs Exp $
00020 */
00021 #ifndef skInputSource_h
00022 #define skInputSource_h
00023 
00024 
00025 #include "skString.h"
00026 #include <stdio.h>
00027 
00028 #ifdef STREAMS_ENABLED
00029 #include <fstream.h>
00030 #endif
00031 
00036 class CLASSEXPORT skInputSource
00037 #ifdef __SYMBIAN32__
00038 : public CBase
00039 #endif
00040 {
00041 public:
00042   virtual ~skInputSource();
00046   virtual bool eof() const=0;
00050   virtual int get()=0;
00054   virtual int peek()=0;
00058   virtual skString readAllToString()=0;
00059 };
00060 
00061 class CLASSEXPORT skInputFile : public skInputSource
00062 {
00063 public:
00068   IMPORT_C skInputFile(const skString& filename);
00072   IMPORT_C skInputFile();
00077   IMPORT_C void open(const skString& filename);
00078 #ifdef __SYMBIAN32__
00079 
00084   IMPORT_C void open(const TDesC& file);
00085 #endif
00086   virtual ~skInputFile();
00090   virtual bool eof() const;
00094   virtual int get();
00098   virtual int peek();
00103   virtual skString readAllToString();
00104 private:
00105 #ifdef STREAMS_ENABLED
00106   ifstream      m_In;
00107 #else
00108   FILE *        m_In;
00109   bool          m_Peeked;
00110   int           m_PeekedChar;
00111 #endif
00112 #ifdef UNICODE_STRINGS
00113   bool          m_FileIsUnicode;
00114 #endif
00115 };
00116 class CLASSEXPORT skInputString : public skInputSource
00117 {
00118 public:
00123   IMPORT_C skInputString(const skString& in);
00127   virtual ~skInputString();
00131   virtual bool eof() const;
00135   virtual int get();
00139   virtual int peek();
00143   virtual skString readAllToString();
00144 private:
00145   skString      m_In;
00146   unsigned int  m_Pos;
00147   bool          m_Peeked;
00148   int           m_PeekedChar;
00149 };
00150 
00151 #endif

Generated on Mon Apr 14 16:49:00 2003 for Simkin C++ for Symbian by doxygen1.3