Qore Programming Language 1.18.0
Loading...
Searching...
No Matches
InputStreamWrapper Class Reference

Implements the private data for all subclasses of Qore::InputStream implemented in the Qore language. More...

#include <InputStreamWrapper.h>

Inheritance diagram for InputStreamWrapper:
[legend]
Collaboration diagram for InputStreamWrapper:
[legend]

Public Member Methods

 InputStreamWrapper (QoreObject *self)
 Constructor. More...
 
virtual DLLLOCAL const char * getName () override
 Returns the name of the class. More...
 
virtual DLLLOCAL int64 peek (ExceptionSink *xsink) override
 Peeks the next byte from the input stream. More...
 
virtual DLLLOCAL int64 read (void *ptr, int64 limit, ExceptionSink *xsink) override
 Reads up to `limit` bytes from the input stream. More...
 
- Public Member Methods inherited from InputStream
virtual int64 peek (ExceptionSink *xsink)=0
 Peeks the next byte from the input stream. More...
 
DLLLOCAL QoreValue peekHelper (ExceptionSink *xsink)
 Helper method that checks that the current thread is the same as when the instance was created, calls peek() and wraps the result to Qore's `int` value. More...
 
virtual int64 read (void *ptr, int64 limit, ExceptionSink *xsink)=0
 Reads up to `limit` bytes from the input stream. More...
 
DLLLOCAL BinaryNodereadHelper (int64 limit, ExceptionSink *xsink)
 Helper method that checks that the current thread is the same as when the instance was created, calls read() and wraps the read data to Qore's `binary` value. More...
 
- Public Member Methods inherited from StreamBase
DLLLOCAL bool check (ExceptionSink *xsink)
 Checks that the current thread is the same as when the instance was created or assigned via unassignThread() and reassignThread() and that the stream has not yet been closed. More...
 
virtual DLLLOCAL const char * getName ()=0
 Returns the name of the class. More...
 
DLLLOCAL int getThreadId ()
 Get currently assigned thread id.
 
DLLLOCAL void reassignThread (ExceptionSink *xsink)
 Reassigns current thread as thread used for stream manipulation, see check() More...
 
DLLLOCAL void unassignThread (ExceptionSink *xsink)
 Unassigns current thread as thread used for stream manipulation, see check() More...
 
- Public Member Methods inherited from AbstractPrivateData
virtual DLLLOCAL void deref ()
 decrements the reference count of the object without the possibility of throwing a Qore-language exception
 
virtual DLLLOCAL void deref (ExceptionSink *xsink)
 decrements the reference count of the object More...
 
DLLLOCAL void ref () const
 increments the reference count of the object
 
- Public Member Methods inherited from QoreReferenceCounter
DLLEXPORT QoreReferenceCounter ()
 creates the reference counter object
 
DLLEXPORT QoreReferenceCounter (const QoreReferenceCounter &old)
 creates a new object with a reference count of 1 More...
 
DLLEXPORT ~QoreReferenceCounter ()
 destroys the reference counter object
 
DLLEXPORT bool is_unique () const
 returns true if the reference count is 1 More...
 
DLLEXPORT int reference_count () const
 gets the reference count More...
 
DLLEXPORT bool ROdereference () const
 atomically decrements the reference count More...
 
DLLEXPORT void ROreference () const
 atomically increments the reference count
 

Additional Inherited Members

- Private Member Methods inherited from InputStream
 InputStream ()=default
 Constructor.
 
- Private Member Methods inherited from StreamBase
 StreamBase ()
 Constructor.
 
- Private Member Methods inherited from AbstractPrivateData
virtual DLLLOCAL ~AbstractPrivateData ()
 as these objects are reference counted, the destructor should be called only when the reference count = 0 and not manually
 

Detailed Description

Implements the private data for all subclasses of Qore::InputStream implemented in the Qore language.

Constructor & Destructor Documentation

◆ InputStreamWrapper()

InputStreamWrapper::InputStreamWrapper ( QoreObject self)
inline

Constructor.

Parameters
selfthe QoreObject this private data is associated with

Member Function Documentation

◆ getName()

virtual DLLLOCAL const char * InputStreamWrapper::getName ( )
inlineoverridevirtual

Returns the name of the class.

Returns
the name of the class

Implements StreamBase.

◆ peek()

virtual DLLLOCAL int64 InputStreamWrapper::peek ( ExceptionSink xsink)
inlineoverridevirtual

Peeks the next byte from the input stream.

Parameters
xsinkthe exception sink
Returns
the next byte available to be read, -1 indicates end of the stream, -2 indicates an error

Implements InputStream.

References QoreObject::evalMethod().

◆ read()

virtual DLLLOCAL int64 InputStreamWrapper::read ( void *  ptr,
int64  limit,
ExceptionSink xsink 
)
inlineoverridevirtual

Reads up to `limit` bytes from the input stream.

Parameters
ptrthe destination buffer to read data into
limitthe maximum number of bytes to read, must be > 0
xsinkthe exception sink
Returns
the number of bytes read, 0 indicates the end of the stream

Implements InputStream.

References QoreObject::evalMethod(), QoreObject::getClassName(), BinaryNode::getPtr(), ExceptionSink::raiseException(), and BinaryNode::size().


The documentation for this class was generated from the following file: