Qore Programming Language 1.19.2
Loading...
Searching...
No Matches
FileOutputStream Class Reference

Private data for the Qore::FileOutputStream class. More...

#include <FileOutputStream.h>

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

Public Member Methods

DLLLOCAL void close (ExceptionSink *xsink) override
 Flushes any buffered (unwritten) bytes, closes the output stream and releases resources. More...
 
DLLLOCAL const char * getName () override
 Returns the name of the class. More...
 
DLLLOCAL bool isClosed () override
 Returns true is the stream has been closed. More...
 
DLLLOCAL void write (const void *ptr, int64 count, ExceptionSink *xsink) override
 Writes bytes to the output stream. More...
 
- Public Member Methods inherited from OutputStream
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 void close (ExceptionSink *xsink)=0
 Flushes any buffered (unwritten) bytes, closes the output stream and releases resources. More...
 
DLLLOCAL void closeHelper (ExceptionSink *xsink)
 Helper method that checks that the current thread is the same as when the instance was created, that the stream has not yet been closed and calls close(). More...
 
virtual bool isClosed ()=0
 Returns true is the stream has been closed. More...
 
virtual void write (const void *ptr, int64 count, ExceptionSink *xsink)=0
 Writes bytes to the output stream. More...
 
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, that the stream has not yet been closed and calls write(). More...
 
DLLLOCAL void writeHelper (const QoreString *data, ExceptionSink *xsink)
 Helper method that checks that the current thread is the same as when the instance was created, that the stream has not yet been closed and calls write(). 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 OutputStream
 OutputStream ()=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

Private data for the Qore::FileOutputStream class.

Member Function Documentation

◆ close()

DLLLOCAL void FileOutputStream::close ( ExceptionSink xsink)
inlineoverridevirtual

Flushes any buffered (unwritten) bytes, closes the output stream and releases resources.

Parameters
xsinkthe exception sink

Implements OutputStream.

References QoreFile::close(), isClosed(), and ExceptionSink::raiseException().

◆ getName()

DLLLOCAL const char * FileOutputStream::getName ( )
inlineoverridevirtual

Returns the name of the class.

Returns
the name of the class

Implements StreamBase.

◆ isClosed()

DLLLOCAL bool FileOutputStream::isClosed ( )
inlineoverridevirtual

Returns true is the stream has been closed.

Returns
true is the stream has been closed

Implements OutputStream.

References QoreFile::isOpen().

Referenced by close(), and write().

◆ write()

DLLLOCAL void FileOutputStream::write ( const void *  ptr,
int64  count,
ExceptionSink xsink 
)
inlineoverridevirtual

Writes bytes to the output stream.

Parameters
ptrthe source buffer to write to the stream
countthe number of bytes to write, must be >= 0
xsinkthe exception sink

Implements OutputStream.

References isClosed(), ExceptionSink::raiseException(), and QoreFile::write().


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