32 #ifndef _QORE_OUTPUTSTREAM_H
33 #define _QORE_OUTPUTSTREAM_H
35 #include "qore/StreamBase.h"
37 DLLEXPORT
extern QoreClass* QC_OUTPUTSTREAM;
60 xsink->
raiseException(
"OUTPUT-STREAM-CLOSED-ERROR",
"this %s object has been already closed",
getName());
holds arbitrary binary data
Definition: BinaryNode.h:41
DLLEXPORT size_t size() const
returns the number of bytes in the object
DLLEXPORT const void * getPtr() const
returns the pointer to the data
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
DLLEXPORT AbstractQoreNode * raiseException(const char *err, const char *fmt,...)
appends a Qore-language exception to the list
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.
DLLLOCAL void closeHelper(ExceptionSink *xsink)
Helper method that checks that the current thread is the same as when the instance was created,...
Definition: OutputStream.h:71
DLLLOCAL void writeHelper(const BinaryNode *data, ExceptionSink *xsink)
Helper method that checks that the current thread is the same as when the instance was created,...
Definition: OutputStream.h:84
OutputStream()=default
Constructor.
virtual void close(ExceptionSink *xsink)=0
Flushes any buffered (unwritten) bytes, closes the output stream and releases resources.
DLLLOCAL bool check(ExceptionSink *xsink)
Checks that the current thread is the same as when the instance was created or assigned via unassignT...
Definition: OutputStream.h:54
defines a Qore-language class
Definition: QoreClass.h:239
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:93
DLLEXPORT size_t size() const
returns number of bytes in the string (not including the null pointer)
DLLEXPORT const char * c_str() const
returns the string's buffer; this data should not be changed
Base class for private data of stream implementations in C++.
Definition: StreamBase.h:44
virtual DLLLOCAL const char * getName()=0
Returns the name of the class.
DLLLOCAL bool check(ExceptionSink *xsink)
Checks that the current thread is the same as when the instance was created or assigned via unassignT...
Definition: StreamBase.h:53
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