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.

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

mercurial