StdOutStream.h 891 B

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