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());
131 #endif // _QORE_OUTPUTSTREAM_H DLLEXPORT const char * c_str() const
returns the string's buffer; this data should not be changed
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
virtual void close(ExceptionSink *xsink)=0
Flushes any buffered (unwritten) bytes, closes the output stream and releases resources.
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
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:81
virtual void write(const void *ptr, int64 count, ExceptionSink *xsink)=0
Writes bytes to the output stream.
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
virtual DLLLOCAL const char * getName()=0
Returns the name of the class.
defines a Qore-language class
Definition: QoreClass.h:237
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:46
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
DLLEXPORT const void * getPtr() const
returns the pointer to the data
Base class for private data of stream implementations in C++.
Definition: StreamBase.h:44
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
DLLEXPORT qore_size_t size() const
returns the number of bytes in the object
OutputStream()=default
Constructor.
DLLEXPORT qore_size_t size() const
returns number of bytes in the string (not including the null pointer)
holds arbitrary binary data
Definition: BinaryNode.h:41
virtual bool isClosed()=0
Returns true is the stream has been closed.