1 // Common/StdInStream.h 2 3 #ifndef __COMMON_STDINSTREAM_H 4 #define __COMMON_STDINSTREAM_H 5 6 #include <stdio.h> 7 8 #include "MyString.h" 9 #include "Types.h" 10 11 class CStdInStream 12 { 13 bool _streamIsOpen; 14 FILE *_stream; 15 public: CStdInStream()16 CStdInStream(): _streamIsOpen(false) {}; CStdInStream(FILE * stream)17 CStdInStream(FILE *stream): _streamIsOpen(false), _stream(stream) {}; 18 ~CStdInStream(); 19 bool Open(LPCTSTR fileName); 20 bool Close(); 21 22 AString ScanStringUntilNewLine(bool allowEOF = false); 23 void ReadToString(AString &resultString); 24 UString ScanUStringUntilNewLine(); 25 26 bool Eof(); 27 int GetChar(); 28 }; 29 30 extern CStdInStream g_StdIn; 31 32 #endif 33