1baa3858d3f5d128a5c8466b700098109edcad5f2repo sync// Common/StdOutStream.h 2baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 3baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#ifndef __COMMON_STDOUTSTREAM_H 4baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define __COMMON_STDOUTSTREAM_H 5baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 6baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include <stdio.h> 7baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 8baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "Types.h" 9baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 10baa3858d3f5d128a5c8466b700098109edcad5f2repo syncclass CStdOutStream 11baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{ 12baa3858d3f5d128a5c8466b700098109edcad5f2repo sync bool _streamIsOpen; 13baa3858d3f5d128a5c8466b700098109edcad5f2repo sync FILE *_stream; 14baa3858d3f5d128a5c8466b700098109edcad5f2repo syncpublic: 15baa3858d3f5d128a5c8466b700098109edcad5f2repo sync CStdOutStream (): _streamIsOpen(false), _stream(0) {}; 16baa3858d3f5d128a5c8466b700098109edcad5f2repo sync CStdOutStream (FILE *stream): _streamIsOpen(false), _stream(stream) {}; 17baa3858d3f5d128a5c8466b700098109edcad5f2repo sync ~CStdOutStream (); 18baa3858d3f5d128a5c8466b700098109edcad5f2repo sync operator FILE *() { return _stream; } 19baa3858d3f5d128a5c8466b700098109edcad5f2repo sync bool Open(const char *fileName); 20baa3858d3f5d128a5c8466b700098109edcad5f2repo sync bool Close(); 21baa3858d3f5d128a5c8466b700098109edcad5f2repo sync bool Flush(); 22baa3858d3f5d128a5c8466b700098109edcad5f2repo sync CStdOutStream & operator<<(CStdOutStream & (* aFunction)(CStdOutStream &)); 23baa3858d3f5d128a5c8466b700098109edcad5f2repo sync CStdOutStream & operator<<(const char *string); 24baa3858d3f5d128a5c8466b700098109edcad5f2repo sync CStdOutStream & operator<<(const wchar_t *string); 25baa3858d3f5d128a5c8466b700098109edcad5f2repo sync CStdOutStream & operator<<(char c); 26baa3858d3f5d128a5c8466b700098109edcad5f2repo sync CStdOutStream & operator<<(int number); 27baa3858d3f5d128a5c8466b700098109edcad5f2repo sync CStdOutStream & operator<<(UInt64 number); 28baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}; 29baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 30baa3858d3f5d128a5c8466b700098109edcad5f2repo syncCStdOutStream & endl(CStdOutStream & outStream); 31baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 32baa3858d3f5d128a5c8466b700098109edcad5f2repo syncextern CStdOutStream g_StdOut; 33baa3858d3f5d128a5c8466b700098109edcad5f2repo syncextern CStdOutStream g_StdErr; 34baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 35baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#endif 36