00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 {
00038 public:
00039 virtual bool eof() const=0;
00040 virtual int get()=0;
00041 virtual int peek()=0;
00042 virtual skString readAllToString()=0;
00043
00044 };
00045
00046 class CLASSEXPORT skInputFile : public skInputSource
00047 {
00048 public:
00049 skInputFile(const skString& filename);
00050 ~skInputFile();
00051 bool eof() const;
00052 int get();
00053 int peek();
00054 skString readAllToString();
00055
00056 private:
00057 #ifdef STREAMS_ENABLED
00058 ifstream m_In;
00059 #else
00060 FILE * m_In;
00061 bool m_Peeked;
00062 int m_PeekedChar;
00063 #endif
00064 #ifdef UNICODE_STRINGS
00065 bool m_FileIsUnicode;
00066 #endif
00067 };
00068 class CLASSEXPORT skInputString : public skInputSource
00069 {
00070 public:
00071 skInputString(const skString& in);
00072 bool eof() const;
00073 int get();
00074 int peek();
00075 skString readAllToString();
00076
00077 private:
00078 skString m_In;
00079 unsigned int m_Pos;
00080 bool m_Peeked;
00081 int m_PeekedChar;
00082 };
00083
00084 #endif