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