Mako 7.4.0 API
Loading...
Searching...
No Matches
IOutputStream Class Referenceabstract

Generic output stream. Abstract base class for output streams. More...

#include <edlstream.h>

Inheritance diagram for IOutputStream:

Public Member Functions

virtual int32 write (const char *str)
 Perform a write.
 
virtual int32 writeFormatted (const char *fmt,...)
 Perform a formatted write as per fprintf().
 
virtual void writeFormattedE (const char *fmt,...)
 As writeFormatted(), but throws an exception if the operation fails.
 
virtual bool completeWrite (const void *buffer, int32 count)
 Perform a complete write.
 
virtual bool completeWrite (const char *str)
 Perform a complete write.
 
virtual void completeWriteE (const void *buffer, int32 count)
 As completeWrite(), but throws an exception if the operation fails.
 
virtual void completeWriteE (const char *str)
 As completeWrite(), but throws an exception if the operation fails.
 
- Public Member Functions inherited from IEDLStream
virtual bool isValid () const =0
 Determine stream validity.
 
virtual bool open ()
 Opens the stream.
 
virtual void openE ()=0
 As per open(), but will throw an exception on failure (IEDLError) that for some stream types may contain additional failure information.
 
virtual void close ()=0
 Closes the stream.
 
virtual int64 getPos ()=0
 Get current stream position.
 
- Public Member Functions inherited from IEDLObject
virtual const CClassIDgetClassID () const =0
 Returns class ID of IEDLObject.
 
virtual bool init (CClassParams *pData)
 The init() method is called to perform any post-construction initialization of an IEDLObject that has been created by the EDL class factory, before it is actually returned by the factory.
 
virtual bool clone (IEDLObjectPtr &ptrObject, IEDLClassFactory *pFactory)
 Create a copy of EDLObject.
 
- Public Member Functions inherited from IRCObject
virtual void addRef () const =0
 Increases the reference count of the actual object pointed to. This would take place during an assignment or copying.
 
virtual bool decRef () const =0
 Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to.
 
virtual int32 getRefCount () const =0
 Retrieve the current reference count of the actual object pointed to.
 

Static Public Member Functions

static EDL_API IRAOutputStreamPtr createToFile (IEDLClassFactory *pFactory, const EDLSysString &path, bool append=false)
 Creation function for an IOutputStream for a file on disk. Throws an IEDLError exception on failure.
 
static EDL_API IRAOutputStreamPtr createToFile (IEDLClassFactory *pFactory, const EDLString &path, bool append=false)
 Creation function for an IOutputStream for a file on disk. Throws an IEDLError exception on failure.
 
static EDL_API IOutputStreamPtr createFromUserWriteFunc (IEDLClassFactory *pFactory, UserStreamWriteFunc writeFunc, void *priv)
 Creation function for an IOutputStream from a user function that provides data. Throws an IEDLError exception on failure.
 
static EDL_API IOutputStreamPtr createToFlateCompressed (IEDLClassFactory *pFactory, const IOutputStreamPtr &stream, uint32 compressionLevel, bool raw=true)
 Creation routine for an output stream for compressing a flate stream. Throws an IEDLError exception on failure.
 
static EDL_API IOutputStreamPtr createToLz4Compressed (IEDLClassFactory *pFactory, const IOutputStreamPtr &stream, bool openSourceStream=true)
 Creation routine for an output stream for compressing an lz4 stream. Throws an IEDLError exception on failure. Note: This is not intended for interoperability with other LZ4 formats, but is useful for things like temporary storage.
 
static EDL_API int64 copy (const IInputStreamPtr &inStream, const IOutputStreamPtr &outStream)
 Copy a source stream to a destination stream. Opens and closes both the input and output streams. Throws an IEDLError exception on failure.
 
static EDL_API int64 writeStream (const IInputStreamPtr &inStream, const IOutputStreamPtr &outStream)
 Write the contents of the given stream to an output stream. Opens and closes the input, but does not open or close the output. Throws an IEDLError exception on failure.
 

Additional Inherited Members

- Protected Member Functions inherited from IRCObject
virtual ~IRCObject ()
 Virtual destructor.
 

Detailed Description

Generic output stream. Abstract base class for output streams.

Member Function Documentation

◆ completeWrite() [1/2]

virtual bool IOutputStream::completeWrite ( const char * str)
inlinevirtual

Perform a complete write.

Parameters
strC-style string that contains the text to be written to the output.
Returns
bool True if the write operation was successful, or false if the write could not be completely fulfilled.

◆ completeWrite() [2/2]

virtual bool IOutputStream::completeWrite ( const void * buffer,
int32 count )
virtual

Perform a complete write.

Parameters
bufferAddress of buffer.
countNumber of bytes to be written.
Returns
bool True if the write operation was successful, or false if the write could not be completely fulfilled.

◆ completeWriteE() [1/2]

virtual void IOutputStream::completeWriteE ( const char * str)
inlinevirtual

As completeWrite(), but throws an exception if the operation fails.

Parameters
strC-style string that contains the text to be written to the output.

◆ completeWriteE() [2/2]

virtual void IOutputStream::completeWriteE ( const void * buffer,
int32 count )
virtual

As completeWrite(), but throws an exception if the operation fails.

Parameters
bufferAddress of buffer.
countNumber of bytes to be written.

◆ copy()

static EDL_API int64 IOutputStream::copy ( const IInputStreamPtr & inStream,
const IOutputStreamPtr & outStream )
static

Copy a source stream to a destination stream. Opens and closes both the input and output streams. Throws an IEDLError exception on failure.

Parameters
inStreamThe source stream.
outStreamThe destination stream.
Returns
int64 The number of bytes copied.

◆ createFromUserWriteFunc()

static EDL_API IOutputStreamPtr IOutputStream::createFromUserWriteFunc ( IEDLClassFactory * pFactory,
UserStreamWriteFunc writeFunc,
void * priv )
static

Creation function for an IOutputStream from a user function that provides data. Throws an IEDLError exception on failure.

Parameters
pFactoryThe class factory.
writeFuncA function that when called, will write the data for the stream.
privAn opaque private pointer that is passed to the readFunc on each call.
Returns
IOutputStreamPtr The new input stream.

◆ createToFile() [1/2]

static EDL_API IRAOutputStreamPtr IOutputStream::createToFile ( IEDLClassFactory * pFactory,
const EDLString & path,
bool append = false )
static

Creation function for an IOutputStream for a file on disk. Throws an IEDLError exception on failure.

Parameters
pFactoryThe EDL class factory.
pathPath to the file.
appendSpecify what to do if the file exists. Optional
  • If false the file will be overwritten by new content. Default.
  • If true new content will be added to the end of the file.
Returns
IOutputStreamPtr The new output stream.

◆ createToFile() [2/2]

static EDL_API IRAOutputStreamPtr IOutputStream::createToFile ( IEDLClassFactory * pFactory,
const EDLSysString & path,
bool append = false )
static

Creation function for an IOutputStream for a file on disk. Throws an IEDLError exception on failure.

Parameters
pFactoryThe EDL class factory.
pathPath to the file.
appendSpecify what to do if the file exists. Optional
  • If false the file will be overwritten by new content. Default.
  • If true new content will be added to the end of the file.
Returns
IOutputStreamPtr The new output stream.

◆ createToFlateCompressed()

static EDL_API IOutputStreamPtr IOutputStream::createToFlateCompressed ( IEDLClassFactory * pFactory,
const IOutputStreamPtr & stream,
uint32 compressionLevel,
bool raw = true )
static

Creation routine for an output stream for compressing a flate stream. Throws an IEDLError exception on failure.

Parameters
pFactoryThe class factory.
streamThe compressed stream.
compressionLevelValues are in the range 1 (fastest, least compression) through 9 (slowest, most compression).
rawPass true if the flate stream should have no zlib header.
Returns
IOutputStreamPtr The new output stream.

◆ createToLz4Compressed()

static EDL_API IOutputStreamPtr IOutputStream::createToLz4Compressed ( IEDLClassFactory * pFactory,
const IOutputStreamPtr & stream,
bool openSourceStream = true )
static

Creation routine for an output stream for compressing an lz4 stream. Throws an IEDLError exception on failure. Note: This is not intended for interoperability with other LZ4 formats, but is useful for things like temporary storage.

Parameters
pFactoryThe class factory.
streamThe compressed stream.
openSourceStreamIf true, the source stream will be opened and closed. If false, it is assumed that the stream is already open and the stream will not be closed on completion.
Returns
IOutputStreamPtr The new output stream.

◆ write()

virtual int32 IOutputStream::write ( const char * str)
inlinevirtual

Perform a write.

Parameters
strC-style string that contains the text to be written to the output.
Returns
int32 On success, the total number of characters written.

◆ writeFormatted()

virtual int32 IOutputStream::writeFormatted ( const char * fmt,
... )
virtual

Perform a formatted write as per fprintf().

Parameters
fmtC-style string that contains the text to be written to the output.
...Additional arguments as specified by fmt.
Returns
int32 On success, the total number of characters written.

◆ writeFormattedE()

virtual void IOutputStream::writeFormattedE ( const char * fmt,
... )
virtual

As writeFormatted(), but throws an exception if the operation fails.

Parameters
fmtC-style string that contains the text to be written to the output.
...Additional arguments as specified by fmt.

◆ writeStream()

static EDL_API int64 IOutputStream::writeStream ( const IInputStreamPtr & inStream,
const IOutputStreamPtr & outStream )
static

Write the contents of the given stream to an output stream. Opens and closes the input, but does not open or close the output. Throws an IEDLError exception on failure.

Parameters
inStreamThe source stream.
outStreamThe destination stream.
Returns
int64 The number of bytes written.

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