misc/libphysfs/lzma/CPP/Common/StdOutStream.h
author antonc27 <antonc27@mail.ru>
Sun, 18 Mar 2018 18:47:03 +0100
branchios-develop
changeset 13250 195208deff1d
parent 12218 bb5522e88ab2
permissions -rw-r--r--
- Correct initialisation of TeamsGameOver (on mobile it doesn't get reset between plays, so ones set to true, prevents game to be finished next time)

// Common/StdOutStream.h

#ifndef __COMMON_STDOUTSTREAM_H
#define __COMMON_STDOUTSTREAM_H

#include <stdio.h>

#include "Types.h"

class CStdOutStream 
{
  bool _streamIsOpen;
  FILE *_stream;
public:
  CStdOutStream (): _streamIsOpen(false), _stream(0) {};
  CStdOutStream (FILE *stream): _streamIsOpen(false), _stream(stream) {};
  ~CStdOutStream ();
  operator FILE *() { return _stream; }
  bool Open(const char *fileName);
  bool Close();
  bool Flush();
  CStdOutStream & operator<<(CStdOutStream & (* aFunction)(CStdOutStream  &));
  CStdOutStream & operator<<(const char *string);
  CStdOutStream & operator<<(const wchar_t *string);
  CStdOutStream & operator<<(char c);
  CStdOutStream & operator<<(int number);
  CStdOutStream & operator<<(UInt64 number);
};

CStdOutStream & endl(CStdOutStream & outStream);

extern CStdOutStream g_StdOut;
extern CStdOutStream g_StdErr;

#endif