Generic input stream. Abstract base class for all input streams. More...
#include <edlstream.h>
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 CClassID & | getClassID () 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. | |
Generic input stream. Abstract base class for all input streams.
|
virtual |
Perform a complete read.
buffer | Buffer to accept the data. |
count | Number of bytes to be read into the buffer. |
|
virtual |
As completeRead(), but throws an exception if the operation fails.
buffer | Address of buffer. |
count | Number of bytes to be read. |
|
static |
Creation routine for creating a composite input stream representing the concatenation of a series of streams.
pFactory | The class factory. |
streams | The vector of streams to use. |
|
static |
Creation function for an IInputStream for a file on disk. Throws an IEDLError exception on failure.
pFactory | The class factory. |
path | Path to the file. |
|
static |
Creation function for an IInputStream for a file on disk. Throws an IEDLError exception on failure.
pFactory | The class factory. |
path | Path to the file. |
|
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.
pFactory | The class factory. |
path | Path to the file. |
|
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.
pFactory | The class factory. |
path | Path to the file. |
|
static |
Creation routine for a input stream for decompressing a flate stream. Throws an IEDLError exception on failure.
pFactory | The class factory. |
stream | The compressed stream. |
raw | Pass to true if the flate stream has no zlib header. |
ignoreChecksums | Pass true if checksum errors should be ignored. |
|
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.
pFactory | The class factory. |
stream | The compressed stream. |
|
static |
Creation function for an IInputStream for data in memory. Throws an IEDLError exception on failure.
pFactory | The class factory. |
mem | A pointer to the memory to be used as the source data for the stream. |
length | The length of the buffer pointed to by mem. |
copy | If true, a copy of the memory pointed to by mem will be made and will be managed and released by the stream. |
free | If 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. |
|
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.
pFactory | The class factory. |
path | Path to the file. |
stream | The stream to populate the new file with. |
|
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.
pFactory | The class factory. |
path | Path to the file. |
stream | The stream to populate the new file with. |
|
static |
Creation routine for a input stream for applying a predictor algorithm to a compressed stream. Throws an IEDLError exception on failure.
pFactory | The class factory. |
stream | The compressed stream. |
predictor | The 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). |
colors | The number of interleaved color components per sample, which must be greater or equal to 1. |
bitsPerComponent | The number of bits used to represent each color component in a sample. Valid values are 1, 2, 4, 8, and 16. |
columns | The number of samples in each row. |
|
static |
Creation function for an IRAInputStream from a user function that provides random access. Throws an IEDLError exception on failure.
pFactory | The class factory. |
length | The stream length. |
readFunc | A function that when called, will provide the data for the stream. |
priv | An opaque private pointer that is passed to the readFunc on each call. |
|
static |
Creation function for an IInputStream from a user function that provides data. Throws an IEDLError exception on failure.
pFactory | The class factory. |
readFunc | A function that when called, will provide the data for the stream. |
priv | An opaque private pointer that is passed to the readFunc on each call. |
|
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.
pFactory | The class factory. |
sourceStream | The source stream to use. |
clone | If true, the input stream is cloned. If false, the existing stream is used in place. |
|
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.
pFactory | The class factory. Must be a Mako instance. |
stream | The stream to use for source. |
|
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.
pFactory | The class factory. |
stream | The source stream to share. Will be cloned. |
|
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.
pFactory | The class factory. |
stream | The stream to use for source. |
offset | The offset within the source stream of the start of the data to use. |
length | The length of source data to use. |
|
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.
pFactory | The class factory. |
sourceStream | The source stream to use. |
openSource | If 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. |
|
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.
pFactory | The class factory. |
sourceStream | The source stream to use. |
|
pure virtual |
Determine if the stream has exhausted.
|
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.
sourceCanonicalPath | Reference to receive the UTF-8 path to the ultimate source file, if available. |
|
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().
sourcePath | Reference to receive the UTF-8 path to the ultimate source file, if available. |
|
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.
hash | A reference to receive the hash value. |
Implements IDOMHashable.
|
pure virtual |
Read single byte from a stream.
|
pure virtual |
Read specified number of bytes from a stream into buffer.
buffer | Buffer to accept the data. |
count | Number of bytes to read. |
|
inlinevirtual |
Skip a specified number of bytes.
count | Number of bytes to skip. |