other-licenses/7zstub/src/Common/StdInStream.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

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

mercurial