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

Generic input stream. Abstract base class for all input streams. More...

#include <edlstream.h>

Inheritance diagram for IInputStream:

Public Member Functions

virtual int32 read (void *buffer, int32 count)=0
 Read specified number of bytes from a stream into buffer.
 
virtual int8 read ()=0
 Read single byte from a stream.
 
virtual bool eof () const =0
 Determine if the stream has exhausted.
 
virtual int64 skip (int64 count)
 Skip a specified number of bytes.
 
virtual bool getSourceFilePath (EDLSysString &sourcePath)=0
 If available, find the file path of the file that this stream references, or for streams that take their input from other streams, the ultimate source stream. If at all possible, the source path will be canonicalised, but this is not guaranteed. If a canonical name is absolutely required, check getCanonicalSourceFilePath().
 
virtual bool getCanonicalSourceFilePath (EDLSysString &sourceCanonicalPath)=0
 If available, find the canonical file path of the file that this stream references, or for streams that take their input from other streams, the ultimate source stream. For canonical names to be discovered on all platforms, the underlying file must exist. If the canonical file path cannot be determined, false will be returned. In which case, you may wish to try getSourceFilePath() above.
 
virtual bool completeRead (void *buffer, int32 count)
 Perform a complete read.
 
virtual void completeReadE (void *buffer, int32 count)
 As completeRead(), but throws an exception if the operation fails.
 
virtual bool hash (uint64 &hash)
 Obtain a 64-bit hash of the stream. Please note that this requires reading the stream and is therefore not thread safe. If thread safety is desired, make a clone of the stream first.
 
- 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.
 
- Public Member Functions inherited from IDOMHashable
virtual ~IDOMHashable ()
 Virtual destructor.
 
virtual uint64 hashE ()
 As hash(), but throws an exception if the operation fails.
 

Static Public Member Functions

static EDL_API IRAInputStreamPtr createFromFile (IEDLClassFactory *pFactory, const EDLSysString &path)
 Creation function for an IInputStream for a file on disk. Throws an IEDLError exception on failure.
 
static EDL_API IRAInputStreamPtr createFromFile (IEDLClassFactory *pFactory, const EDLString &path)
 Creation function for an IInputStream for a file on disk. Throws an IEDLError exception on failure.
 
static EDL_API IRAInputStreamPtr createFromFileShared (IEDLClassFactory *pFactory, const EDLSysString &path)
 Creation function for an IInputStream for a file on disk. Similar to createFromFile, but if this file is cloned, only one file handle will be open at a time. This is slower, but is useful if many users are likely to want to have this file open at the same file. On some systems, having too many files open may result in errors. Performance should be acceptable providing there is not a great deal of contention and simultaneous access.
 
static EDL_API IRAInputStreamPtr createFromFileShared (IEDLClassFactory *pFactory, const EDLString &path)
 Creation function for an IInputStream for a file on disk. Similar to createFromFile, but if this stream is cloned, only one file handle will be open at a time. This is slower, but is useful if many users are likely to want to have this file open at the same file. On some systems, having too many files open may result in errors. Performance should be acceptable providing there is not a great deal of contention and simultaneous access.
 
static EDL_API IRAInputStreamPtr createSharedFromStream (IEDLClassFactory *pFactory, const IRAInputStreamPtr &stream)
 Creation function for a shared stream overlaying an existing stream. If this stream is cloned, the underlying file will not be cloned. This is useful if many users are likely to want to have this file open at the same time. On some systems, having too many files open may result in errors. Performance should be acceptable providing there is not a great deal of contention and simultaneous access. Only possible for random access streams. If the stream is already shared, the stream will be returned as is.
 
static EDL_API IRAInputStreamPtr createFromMemory (IEDLClassFactory *pFactory, const void *mem, uint32 length, bool copy=false, bool free=true)
 Creation function for an IInputStream for data in memory. Throws an IEDLError exception on failure.
 
static EDL_API IInputStreamPtr createFromUserReadFunc (IEDLClassFactory *pFactory, UserStreamReadFunc readFunc, void *priv)
 Creation function for an IInputStream from a user function that provides data. Throws an IEDLError exception on failure.
 
static EDL_API IRAInputStreamPtr createFromRAUserFunc (IEDLClassFactory *pFactory, int64 length, UserRAReadFunc readFunc, void *priv)
 Creation function for an IRAInputStream from a user function that provides random access. Throws an IEDLError exception on failure.
 
static EDL_API IRAInputStreamPtr createRandomAccessFromNonRandomAccess (IEDLClassFactory *pFactory, const IInputStreamPtr &stream)
 Creation function to make a random access stream from a stream that is not random access. Currently, the temporary store will be used to store a copy of the source data, but a concrete implementation method should not be assumed. If the source stream is random access, it will be returned as is. Throws an IEDLError exception on failure.
 
static EDL_API IRAInputStreamPtr createFromNewFileWithContents (IEDLClassFactory *pFactory, const EDLSysString &path, const IInputStreamPtr &stream)
 Creation function for an IInputStream for a file on disk created with the contents of an existing stream. Throws an IEDLError exception on failure.
 
static EDL_API IRAInputStreamPtr createFromNewFileWithContents (IEDLClassFactory *pFactory, const EDLString &path, const IInputStreamPtr &stream)
 Creation function for an IInputStream for a file on disk created with the contents of an existing stream. Throws an IEDLError exception on failure.
 
static EDL_API IInputStreamPtr createSubFile (IEDLClassFactory *pFactory, const IInputStreamPtr &stream, int64 offset, int64 length)
 Creation routine for a stream representing a portion of a file on disk. If the source file is random access, then the created file shall be also. Throws an IEDLError exception on failure.
 
static EDL_API IInputStreamPtr createFromFlateCompressed (IEDLClassFactory *pFactory, const IInputStreamPtr &stream, bool raw=true, bool ignoreChecksums=false)
 Creation routine for a input stream for decompressing a flate stream. Throws an IEDLError exception on failure.
 
static EDL_API IInputStreamPtr createFromLz4Compressed (IEDLClassFactory *pFactory, const IInputStreamPtr &stream)
 Creation routine for a input stream for decompressing an lz4 block compressed 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 IInputStreamPtr createFromPredictorCompressed (IEDLClassFactory *pFactory, const IInputStreamPtr &stream, uint8 predictor, uint8 colors, uint8 bitsPerComponent, uint32 columns)
 Creation routine for a input stream for applying a predictor algorithm to a compressed stream. Throws an IEDLError exception on failure.
 
static EDL_API IInputStreamPtr createCompositeStream (IEDLClassFactory *pFactory, const CIInputStreamVect &streams)
 Creation routine for creating a composite input stream representing the concatenation of a series of streams.
 
static EDL_API IInputPushbackStreamPtr createPushbackStream (IEDLClassFactory *pFactory, const IInputStreamPtr &sourceStream, bool clone=true)
 Creation routine for creating a push-back stream using a non-pushback stream as a data source. If the source stream is random access, the resulting stream will also be random access.
 
static EDL_API IInputStreamPtr createUelStream (IEDLClassFactory *pFactory, const IInputStreamPtr &sourceStream)
 Creation routine for a stream that emulates an end-of-file condition should a Universal End of Language (UEL) sequence be encountered in an underlying data source. The resulting stream is not random access. The underlying stream is neither opened nor closed. This stream type is useful for restricting parsing of substreams inside a print stream. Streams of this type are not clonable. Please also note, that this stream must read ahead of read requests in order to search for UEL sequences. However it will never read beyond the UEL sequence.
 
static EDL_API IInputStreamPtr createTbcpStream (IEDLClassFactory *pFactory, const IInputStreamPtr &sourceStream, bool openSource=false)
 Creation routine for a stream that reads data from an underlying stream encoded using Adobe's Tagged Binary Communication Protocol (TBCP). The resulting stream is not random access. Streams of this type are not clonable.
 

Additional Inherited Members

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

Detailed Description

Generic input stream. Abstract base class for all input streams.

Member Function Documentation

◆ completeRead()

virtual bool IInputStream::completeRead ( void * buffer,
int32 count )
virtual

Perform a complete read.

Parameters
bufferBuffer to accept the data.
countNumber of bytes to be read into the buffer.
Returns
bool True if the read operation was successful, or false if the read could not be completely fulfilled.

◆ completeReadE()

virtual void IInputStream::completeReadE ( void * buffer,
int32 count )
virtual

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

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

◆ createCompositeStream()

static EDL_API IInputStreamPtr IInputStream::createCompositeStream ( IEDLClassFactory * pFactory,
const CIInputStreamVect & streams )
static

Creation routine for creating a composite input stream representing the concatenation of a series of streams.

Parameters
pFactoryThe class factory.
streamsThe vector of streams to use.
Returns
IInputStreamPtr The new input stream.

◆ createFromFile() [1/2]

static EDL_API IRAInputStreamPtr IInputStream::createFromFile ( IEDLClassFactory * pFactory,
const EDLString & path )
static

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

Parameters
pFactoryThe class factory.
pathPath to the file.
Returns
IRAInputStreamPtr The new input stream.

◆ createFromFile() [2/2]

static EDL_API IRAInputStreamPtr IInputStream::createFromFile ( IEDLClassFactory * pFactory,
const EDLSysString & path )
static

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

Parameters
pFactoryThe class factory.
pathPath to the file.
Returns
IRAInputStreamPtr The new input stream.

◆ createFromFileShared() [1/2]

static EDL_API IRAInputStreamPtr IInputStream::createFromFileShared ( IEDLClassFactory * pFactory,
const EDLString & path )
static

Creation function for an IInputStream for a file on disk. Similar to createFromFile, but if this stream is cloned, only one file handle will be open at a time. This is slower, but is useful if many users are likely to want to have this file open at the same file. On some systems, having too many files open may result in errors. Performance should be acceptable providing there is not a great deal of contention and simultaneous access.

Parameters
pFactoryThe class factory.
pathPath to the file.
Returns
IRAInputStreamPtr The new input stream.

◆ createFromFileShared() [2/2]

static EDL_API IRAInputStreamPtr IInputStream::createFromFileShared ( IEDLClassFactory * pFactory,
const EDLSysString & path )
static

Creation function for an IInputStream for a file on disk. Similar to createFromFile, but if this file is cloned, only one file handle will be open at a time. This is slower, but is useful if many users are likely to want to have this file open at the same file. On some systems, having too many files open may result in errors. Performance should be acceptable providing there is not a great deal of contention and simultaneous access.

Parameters
pFactoryThe class factory.
pathPath to the file.
Returns
IRAInputStreamPtr The new input stream.

◆ createFromFlateCompressed()

static EDL_API IInputStreamPtr IInputStream::createFromFlateCompressed ( IEDLClassFactory * pFactory,
const IInputStreamPtr & stream,
bool raw = true,
bool ignoreChecksums = false )
static

Creation routine for a input stream for decompressing a flate stream. Throws an IEDLError exception on failure.

Parameters
pFactoryThe class factory.
streamThe compressed stream.
rawPass to true if the flate stream has no zlib header.
ignoreChecksumsPass true if checksum errors should be ignored.
Returns
IInputStreamPtr The new input stream.

◆ createFromLz4Compressed()

static EDL_API IInputStreamPtr IInputStream::createFromLz4Compressed ( IEDLClassFactory * pFactory,
const IInputStreamPtr & stream )
static

Creation routine for a input stream for decompressing an lz4 block compressed 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.
Returns
IInputStreamPtr The new input stream.

◆ createFromMemory()

static EDL_API IRAInputStreamPtr IInputStream::createFromMemory ( IEDLClassFactory * pFactory,
const void * mem,
uint32 length,
bool copy = false,
bool free = true )
static

Creation function for an IInputStream for data in memory. Throws an IEDLError exception on failure.

Parameters
pFactoryThe class factory.
memA pointer to the memory to be used as the source data for the stream.
lengthThe length of the buffer pointed to by mem.
copyIf true, a copy of the memory pointed to by mem will be made and will be managed and released by the stream.
freeIf copy is false and free is true, then when the stream is destroyed, mem will be deallocated using using stdlib free(). Ignored if copy is true.
Returns
IInputStreamPtr The new input stream.

◆ createFromNewFileWithContents() [1/2]

static EDL_API IRAInputStreamPtr IInputStream::createFromNewFileWithContents ( IEDLClassFactory * pFactory,
const EDLString & path,
const IInputStreamPtr & stream )
static

Creation function for an IInputStream for a file on disk created with the contents of an existing stream. Throws an IEDLError exception on failure.

Parameters
pFactoryThe class factory.
pathPath to the file.
streamThe stream to populate the new file with.
Returns
IInputStreamPtr The new input stream.

◆ createFromNewFileWithContents() [2/2]

static EDL_API IRAInputStreamPtr IInputStream::createFromNewFileWithContents ( IEDLClassFactory * pFactory,
const EDLSysString & path,
const IInputStreamPtr & stream )
static

Creation function for an IInputStream for a file on disk created with the contents of an existing stream. Throws an IEDLError exception on failure.

Parameters
pFactoryThe class factory.
pathPath to the file.
streamThe stream to populate the new file with.
Returns
IInputStreamPtr The new input stream.

◆ createFromPredictorCompressed()

static EDL_API IInputStreamPtr IInputStream::createFromPredictorCompressed ( IEDLClassFactory * pFactory,
const IInputStreamPtr & stream,
uint8 predictor,
uint8 colors,
uint8 bitsPerComponent,
uint32 columns )
static

Creation routine for a input stream for applying a predictor algorithm to a compressed stream. Throws an IEDLError exception on failure.

Parameters
pFactoryThe class factory.
streamThe compressed stream.
predictorThe predictor algorithm to apply. Valid values are 2 (TIFF), 10 (PNG None), 11 (PNG Sub), 12 (PNG Up), 13 (PNG average) or 14 (PNG Paeth).
colorsThe number of interleaved color components per sample, which must be greater or equal to 1.
bitsPerComponentThe number of bits used to represent each color component in a sample. Valid values are 1, 2, 4, 8, and 16.
columnsThe number of samples in each row.
Returns
IInputStreamPtr The new input stream.

◆ createFromRAUserFunc()

static EDL_API IRAInputStreamPtr IInputStream::createFromRAUserFunc ( IEDLClassFactory * pFactory,
int64 length,
UserRAReadFunc readFunc,
void * priv )
static

Creation function for an IRAInputStream from a user function that provides random access. Throws an IEDLError exception on failure.

Parameters
pFactoryThe class factory.
lengthThe stream length.
readFuncA function that when called, will provide the data for the stream.
privAn opaque private pointer that is passed to the readFunc on each call.
Returns
IInputStreamPtr The new input stream.

◆ createFromUserReadFunc()

static EDL_API IInputStreamPtr IInputStream::createFromUserReadFunc ( IEDLClassFactory * pFactory,
UserStreamReadFunc readFunc,
void * priv )
static

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

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

◆ createPushbackStream()

static EDL_API IInputPushbackStreamPtr IInputStream::createPushbackStream ( IEDLClassFactory * pFactory,
const IInputStreamPtr & sourceStream,
bool clone = true )
static

Creation routine for creating a push-back stream using a non-pushback stream as a data source. If the source stream is random access, the resulting stream will also be random access.

Parameters
pFactoryThe class factory.
sourceStreamThe source stream to use.
cloneIf true, the input stream is cloned. If false, the existing stream is used in place.
Returns
IInputStreamPtr The new input stream.

◆ createRandomAccessFromNonRandomAccess()

static EDL_API IRAInputStreamPtr IInputStream::createRandomAccessFromNonRandomAccess ( IEDLClassFactory * pFactory,
const IInputStreamPtr & stream )
static

Creation function to make a random access stream from a stream that is not random access. Currently, the temporary store will be used to store a copy of the source data, but a concrete implementation method should not be assumed. If the source stream is random access, it will be returned as is. Throws an IEDLError exception on failure.

Parameters
pFactoryThe class factory. Must be a Mako instance.
streamThe stream to use for source.
Returns
IRAInputStreamPtr A random access stream.

◆ createSharedFromStream()

static EDL_API IRAInputStreamPtr IInputStream::createSharedFromStream ( IEDLClassFactory * pFactory,
const IRAInputStreamPtr & stream )
static

Creation function for a shared stream overlaying an existing stream. If this stream is cloned, the underlying file will not be cloned. This is useful if many users are likely to want to have this file open at the same time. On some systems, having too many files open may result in errors. Performance should be acceptable providing there is not a great deal of contention and simultaneous access. Only possible for random access streams. If the stream is already shared, the stream will be returned as is.

Parameters
pFactoryThe class factory.
streamThe source stream to share. Will be cloned.
Returns
IRAInputStreamPtr The new input stream.

◆ createSubFile()

static EDL_API IInputStreamPtr IInputStream::createSubFile ( IEDLClassFactory * pFactory,
const IInputStreamPtr & stream,
int64 offset,
int64 length )
static

Creation routine for a stream representing a portion of a file on disk. If the source file is random access, then the created file shall be also. Throws an IEDLError exception on failure.

Parameters
pFactoryThe class factory.
streamThe stream to use for source.
offsetThe offset within the source stream of the start of the data to use.
lengthThe length of source data to use.
Returns
IInputStreamPtr The new input stream.

◆ createTbcpStream()

static EDL_API IInputStreamPtr IInputStream::createTbcpStream ( IEDLClassFactory * pFactory,
const IInputStreamPtr & sourceStream,
bool openSource = false )
static

Creation routine for a stream that reads data from an underlying stream encoded using Adobe's Tagged Binary Communication Protocol (TBCP). The resulting stream is not random access. Streams of this type are not clonable.

Parameters
pFactoryThe class factory.
sourceStreamThe source stream to use.
openSourceIf true, opening the stream will open the underlying stream, and the underlying stream will be closed when the stream closes. When set to false the underlying stream is neither opened nor closed. The default is false.
Returns
IInputStreamPtr The new input stream.

◆ createUelStream()

static EDL_API IInputStreamPtr IInputStream::createUelStream ( IEDLClassFactory * pFactory,
const IInputStreamPtr & sourceStream )
static

Creation routine for a stream that emulates an end-of-file condition should a Universal End of Language (UEL) sequence be encountered in an underlying data source. The resulting stream is not random access. The underlying stream is neither opened nor closed. This stream type is useful for restricting parsing of substreams inside a print stream. Streams of this type are not clonable. Please also note, that this stream must read ahead of read requests in order to search for UEL sequences. However it will never read beyond the UEL sequence.

Parameters
pFactoryThe class factory.
sourceStreamThe source stream to use.
Returns
IInputStreamPtr The new input stream.

◆ eof()

virtual bool IInputStream::eof ( ) const
pure virtual

Determine if the stream has exhausted.

Returns
bool True if the stream has exhausted.

◆ getCanonicalSourceFilePath()

virtual bool IInputStream::getCanonicalSourceFilePath ( EDLSysString & sourceCanonicalPath)
pure virtual

If available, find the canonical file path of the file that this stream references, or for streams that take their input from other streams, the ultimate source stream. For canonical names to be discovered on all platforms, the underlying file must exist. If the canonical file path cannot be determined, false will be returned. In which case, you may wish to try getSourceFilePath() above.

Parameters
sourceCanonicalPathReference to receive the UTF-8 path to the ultimate source file, if available.
Returns
bool True if a canonical path could be retrieved.

◆ getSourceFilePath()

virtual bool IInputStream::getSourceFilePath ( EDLSysString & sourcePath)
pure virtual

If available, find the file path of the file that this stream references, or for streams that take their input from other streams, the ultimate source stream. If at all possible, the source path will be canonicalised, but this is not guaranteed. If a canonical name is absolutely required, check getCanonicalSourceFilePath().

Parameters
sourcePathReference to receive the UTF-8 path to the ultimate source file, if available.
Returns
bool True if a path could be retrieved.

◆ hash()

virtual bool IInputStream::hash ( uint64 & hash)
virtual

Obtain a 64-bit hash of the stream. Please note that this requires reading the stream and is therefore not thread safe. If thread safety is desired, make a clone of the stream first.

Parameters
hashA reference to receive the hash value.
Returns
bool True if method succeeded.

Implements IDOMHashable.

◆ read() [1/2]

virtual int8 IInputStream::read ( )
pure virtual

Read single byte from a stream.

Returns
int8 Number of bytes actually read.

◆ read() [2/2]

virtual int32 IInputStream::read ( void * buffer,
int32 count )
pure virtual

Read specified number of bytes from a stream into buffer.

Parameters
bufferBuffer to accept the data.
countNumber of bytes to read.
Returns
int32 The number of bytes actually read.

◆ skip()

virtual int64 IInputStream::skip ( int64 count)
inlinevirtual

Skip a specified number of bytes.

Parameters
countNumber of bytes to skip.
Returns
int64 The number of bytes actually skipped.

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