32 #ifndef _QORE_STDERROUTPUTSTREAM_H 33 #define _QORE_STDERROUTPUTSTREAM_H 35 #include "qore/OutputStream.h" 47 return "StderrOutputStream";
62 const char* current =
reinterpret_cast<const char*
>(ptr);
63 int64 blockCount = count / WRITE_BLOCK_SIZE;
64 for (
int64 i = 0; i < blockCount; i++) {
65 fwrite(current, WRITE_BLOCK_SIZE, 1, stderr);
66 current = (current + WRITE_BLOCK_SIZE);
67 count -= WRITE_BLOCK_SIZE;
69 fwrite(ptr, count, 1, stderr);
72 static const int WRITE_BLOCK_SIZE = 1024;
75 #endif // _QORE_STDERROUTPUTSTREAM_H DLLLOCAL bool isClosed() override
Returns true is the stream has been closed.
Definition: StderrOutputStream.h:50
DLLLOCAL void write(const void *ptr, int64 count, ExceptionSink *xsink) override
Writes bytes to the output stream.
Definition: StderrOutputStream.h:58
Interface for private data of output streams.
Definition: OutputStream.h:44
Private data for the Qore::StderrOutputStream class.
Definition: StderrOutputStream.h:40
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:46
DLLLOCAL const char * getName() override
Returns the name of the class.
Definition: StderrOutputStream.h:46
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:260
DLLLOCAL void close(ExceptionSink *xsink) override
Flushes any buffered (unwritten) bytes, closes the output stream and releases resources.
Definition: StderrOutputStream.h:54