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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/7zstub/src/Common/StdOutStream.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +// Common/StdOutStream.h
     1.5 +
     1.6 +#ifndef __COMMON_STDOUTSTREAM_H
     1.7 +#define __COMMON_STDOUTSTREAM_H
     1.8 +
     1.9 +#include <stdio.h>
    1.10 +
    1.11 +#include "Types.h"
    1.12 +
    1.13 +class CStdOutStream 
    1.14 +{
    1.15 +  bool _streamIsOpen;
    1.16 +  FILE *_stream;
    1.17 +public:
    1.18 +  CStdOutStream (): _streamIsOpen(false) {};
    1.19 +  CStdOutStream (FILE *stream): _streamIsOpen(false), _stream(stream) {};
    1.20 +  ~CStdOutStream ();
    1.21 +  bool Open(const char *fileName);
    1.22 +  bool Close();
    1.23 +  bool Flush();
    1.24 + 
    1.25 +  CStdOutStream & operator<<(CStdOutStream & (* aFunction)(CStdOutStream  &));
    1.26 +  CStdOutStream & operator<<(const char *string);
    1.27 +  CStdOutStream & operator<<(const wchar_t *string);
    1.28 +  CStdOutStream & operator<<(char c);
    1.29 +  CStdOutStream & operator<<(int number);
    1.30 +  CStdOutStream & operator<<(UInt64 number);
    1.31 +};
    1.32 +
    1.33 +CStdOutStream & endl(CStdOutStream & outStream);
    1.34 +
    1.35 +extern CStdOutStream g_StdOut;
    1.36 +extern CStdOutStream g_StdErr;
    1.37 +
    1.38 +#endif

mercurial