32#ifndef _QORE_STREAMWRITER_H
33#define _QORE_STREAMWRITER_H
37#include "qore/qore_bitopts.h"
38#include "qore/OutputStream.h"
64 if (!out->
check(xsink)) {
67 out->
write(ptr, count, xsink);
68 return *xsink ? -1 : 0;
78 return str ? print(*str, xsink) : 0;
83 return str ? print(*str, xsink) : 0;
88 return str ? print(*str, xsink) : 0;
93 return str ? print(*str, xsink) : 0;
98 return *xsink ? -1 : 0;
103 return *xsink ? -1 : 0;
109 return *xsink ? -1 : 0;
115 return *xsink ? -1 : 0;
121 return *xsink ? -1 : 0;
127 return *xsink ? -1 : 0;
133 return *xsink ? -1 : 0;
139 return *xsink ? -1 : 0;
142 DLLLOCAL
int writeu1(
unsigned char i,
ExceptionSink* xsink) {
143 return writei1((
signed char)i, xsink);
147 return writei2((
signed char)i, xsink);
151 return writei4((
signed char)i, xsink);
154 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:50
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 const char * getBuffer() const
returns the string's buffer; this data should not be changed
DLLEXPORT size_t size() const
returns number of bytes in the string (not including the null pointer)
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:50
a templated class to manage a reference count of an object that can throw a Qore-language exception w...
Definition: ReferenceHolder.h:52
manages a reference count of a pointer to a class that takes a simple "deref()" call with no argument...
Definition: ReferenceHolder.h:127
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:1125
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