diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-04-06 13:33:38 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-04-13 11:32:09 +0300 |
commit | 96ade47c182bf37a2efca2aa62922e54e5ff1660 (patch) | |
tree | 93ceee6c6f8984f563f3dfe83e56f98b66b40f3a /src/libs/3rdparty/7zip/unix/CPP/Common/StdOutStream.h | |
parent | 2d5f0ffaf1278516bbd74e3b60f9849f4c51cffa (diff) |
Move LZMA SDK to 3rdparty subdirectory
Also add attribution document.
Task-number: QTIFW-2336
Change-Id: I91546bc6c3ace244e4b546b945f40b7d204f7463
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/libs/3rdparty/7zip/unix/CPP/Common/StdOutStream.h')
-rw-r--r-- | src/libs/3rdparty/7zip/unix/CPP/Common/StdOutStream.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/libs/3rdparty/7zip/unix/CPP/Common/StdOutStream.h b/src/libs/3rdparty/7zip/unix/CPP/Common/StdOutStream.h new file mode 100644 index 000000000..0a8c0febb --- /dev/null +++ b/src/libs/3rdparty/7zip/unix/CPP/Common/StdOutStream.h @@ -0,0 +1,62 @@ +// Common/StdOutStream.h + +#ifndef __COMMON_STD_OUT_STREAM_H +#define __COMMON_STD_OUT_STREAM_H + +#include <stdio.h> + +#include "MyString.h" +#include "MyTypes.h" + +class CStdOutStream +{ + FILE *_stream; + bool _streamIsOpen; +public: + CStdOutStream(): _stream(0), _streamIsOpen(false) {}; + CStdOutStream(FILE *stream): _stream(stream), _streamIsOpen(false) {}; + ~CStdOutStream() { Close(); } + + // void AttachStdStream(FILE *stream) { _stream = stream; _streamIsOpen = false; } + // bool IsDefined() const { return _stream != NULL; } + + operator FILE *() { return _stream; } + bool Open(const char *fileName) throw(); + bool Close() throw(); + bool Flush() throw(); + + CStdOutStream & operator<<(CStdOutStream & (* func)(CStdOutStream &)) + { + (*func)(*this); + return *this; + } + + CStdOutStream & operator<<(const char *s) throw() + { + fputs(s, _stream); + return *this; + } + + CStdOutStream & operator<<(char c) throw() + { + fputc(c, _stream); + return *this; + } + + 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) throw(); + +extern CStdOutStream g_StdOut; +extern CStdOutStream g_StdErr; + +void StdOut_Convert_UString_to_AString(const UString &s, AString &temp); + +#endif |