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