32 #ifndef _QORE_STREAMWRITER_H
33 #define _QORE_STREAMWRITER_H
37 #include "qore/qore_bitopts.h"
38 #include "qore/OutputStream.h"
60 if (!out->
check(xsink)) {
63 out->
write(ptr, count, xsink);
64 return *xsink ? -1 : 0;
74 return str ? print(*str, xsink) : 0;
79 return str ? print(*str, xsink) : 0;
84 return str ? print(*str, xsink) : 0;
89 return str ? print(*str, xsink) : 0;
94 return *xsink ? -1 : 0;
99 return *xsink ? -1 : 0;
105 return *xsink ? -1 : 0;
111 return *xsink ? -1 : 0;
117 return *xsink ? -1 : 0;
123 return *xsink ? -1 : 0;
129 return *xsink ? -1 : 0;
135 return *xsink ? -1 : 0;
138 DLLLOCAL
virtual const char* getName()
const {
return "StreamWriter"; }
DLLEXPORT const QoreEncoding * QCS_DEFAULT
the default encoding for the Qore library
DLLEXPORT QoreStringNode * q_sprintf(const QoreListNode *params, int field, int offset, ExceptionSink *xsink)
a string formatting function that works with Qore data structures
DLLEXPORT QoreStringNode * q_vsprintf(const QoreListNode *params, int field, int offset, ExceptionSink *xsink)
a string formatting function that works with Qore data structures
the base class for all data to be used as private data of Qore objects
Definition: AbstractPrivateData.h:44
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
Interface for private data of output streams.
Definition: OutputStream.h:44
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
defines string encoding functions in Qore
Definition: QoreEncoding.h:83
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
DLLEXPORT size_t size() const
returns number of bytes in the string (not including the null pointer)
DLLEXPORT const char * getBuffer() const
returns the string's buffer; this data should not be changed
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:50
Private data for the Qore::StreamWriter class.
Definition: StreamWriter.h:43
use this class to manage strings where the character encoding must be specified and may be different ...
Definition: QoreString.h:1104
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