This commit is contained in:
Igor Pavlov
2014-11-23 00:00:00 +00:00
committed by Kornel Lesiński
parent 83f8ddcc5b
commit f08f4dcc3c
1158 changed files with 76451 additions and 35082 deletions

41
CPP/Common/StdOutStream.h Executable file → Normal file
View File

@@ -1,33 +1,40 @@
// Common/StdOutStream.h
#ifndef __COMMON_STDOUTSTREAM_H
#define __COMMON_STDOUTSTREAM_H
#ifndef __COMMON_STD_OUT_STREAM_H
#define __COMMON_STD_OUT_STREAM_H
#include <stdio.h>
#include "Types.h"
#include "MyString.h"
#include "MyTypes.h"
class CStdOutStream
{
bool _streamIsOpen;
FILE *_stream;
bool _streamIsOpen;
public:
CStdOutStream (): _streamIsOpen(false), _stream(0) {};
CStdOutStream (FILE *stream): _streamIsOpen(false), _stream(stream) {};
~CStdOutStream ();
CStdOutStream(): _stream(0), _streamIsOpen(false) {};
CStdOutStream(FILE *stream): _stream(stream), _streamIsOpen(false) {};
~CStdOutStream() { Close(); }
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);
bool Open(const char *fileName) throw();
bool Close() throw();
bool Flush() throw();
CStdOutStream & operator<<(CStdOutStream & (* func)(CStdOutStream &));
CStdOutStream & operator<<(const char *s) throw();
CStdOutStream & operator<<(char c) throw();
CStdOutStream & operator<<(Int32 number) throw();
CStdOutStream & operator<<(Int64 number) throw();
CStdOutStream & operator<<(UInt32 number) throw();
CStdOutStream & operator<<(UInt64 number) throw();
CStdOutStream & operator<<(const wchar_t *s);
void PrintUString(const UString &s, AString &temp);
};
CStdOutStream & endl(CStdOutStream & outStream);
CStdOutStream & endl(CStdOutStream & outStream) throw();
extern CStdOutStream g_StdOut;
extern CStdOutStream g_StdErr;