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

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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