32 #ifndef _QORE_TRANSFORMOUTPUTSTREAM_H
33 #define _QORE_TRANSFORMOUTPUTSTREAM_H
35 #include "qore/OutputStream.h"
36 #include "qore/Transform.h"
40 TransformOutputStream(
OutputStream *os,
Transform *t) : os(os), t(t), bufsize(t->outputBufferSize()), closed(false) {
43 const char *
getName()
override {
44 return "TransformOutputStream";
54 std::pair<int64, int64> r = t->apply(
nullptr, 0, buf,
sizeof(buf), xsink);
61 os->write(buf, r.second, xsink);
71 const char *src =
static_cast<const char*
>(ptr);
74 std::pair<int64, int64> r = t->apply(src, len, buf,
sizeof(buf), xsink);
79 os->write(buf, r.second, xsink);
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
Interface for private data of output streams.
Definition: OutputStream.h:44
virtual bool isClosed()=0
Returns true is the stream has been closed.
virtual void write(const void *ptr, int64 count, ExceptionSink *xsink)=0
Writes bytes to the output stream.
virtual void close(ExceptionSink *xsink)=0
Flushes any buffered (unwritten) bytes, closes the output stream and releases resources.
virtual DLLLOCAL const char * getName()=0
Returns the name of the class.
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