Mako 9.0.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
edlstream.h
Go to the documentation of this file.
1/*
2 * edlstream.h
3 *
4 * Copyright (C) 2007-2026 Hybrid Software Helix Ltd. All rights reserved.
5 */
6
14
15#ifndef EDLSTREAM_H
16#define EDLSTREAM_H
17
18#include <fstream>
19#include <edl/edltypes.h>
20#include <edl/iedlobject.h>
21#include <edl/idomhashable.h>
22#include <edl/edlvector.h>
23#include <edl/edlerrors.h>
24#include <edl/edlfwd.h>
25
26#ifdef _WIN32
27#include <cstdarg>
28#endif
29
31
37
38class IEDLStream : virtual public IEDLObject
39{
40 public:
45 virtual bool isValid() const = 0;
46
51 virtual bool open()
52 {
53 try
54 {
55 openE();
56 return true;
57 }
58 catch (IEDLError &e)
59 {
60 if (e.getErrorCode() == EDL_ERR_PANIC)
61 {
62 throw;
63 }
64 return false;
65 }
66 }
67
72 virtual void openE() = 0;
73
77 virtual void close() = 0;
78
83 virtual int64 getPos() = 0;
84};
86#define edlobj2IEDLStream(src) edl_cast((IEDLStream *)nullptr, src)
87
88class IInputStream;
91class IRAInputStream;
94class IRAOutputStream;
98
113typedef int (*UserStreamWriteFunc) (void *pPriv, void *pBuff, unsigned int len);
114
126typedef int (*UserStreamReadFunc) (void *pPriv, void *pBuff, unsigned int len,
127 unsigned int *pLenRead, int *pEof);
128
141typedef int (*UserRAReadFunc) (void *pPriv, void *pBuff, int64 offset, int32 length);
142
148
149class IInputStream : virtual public IEDLStream, virtual public IDOMHashable
150{
151 public:
159 static EDL_API IRAInputStreamPtr createFromFile(IEDLClassFactory *pFactory, const EDLSysString &path);
160
168 static EDL_API IRAInputStreamPtr createFromFile(IEDLClassFactory *pFactory, const EDLString &path);
169
183 static EDL_API IRAInputStreamPtr createFromFileShared(IEDLClassFactory *pFactory, const EDLSysString &path);
184
198 static EDL_API IRAInputStreamPtr createFromFileShared(IEDLClassFactory *pFactory, const EDLString &path);
199
214 static EDL_API IRAInputStreamPtr createSharedFromStream(IEDLClassFactory *pFactory, const IRAInputStreamPtr &stream, bool clone = true);
215
228 static EDL_API IRAInputStreamPtr createFromMemory(IEDLClassFactory *pFactory, const void *mem, uint32 length, bool copy = false, bool free = true);
229
238 static EDL_API IInputStreamPtr createFromUserReadFunc(IEDLClassFactory *pFactory, UserStreamReadFunc readFunc, void *priv);
239
249 static EDL_API IRAInputStreamPtr createFromRAUserFunc(IEDLClassFactory *pFactory, int64 length, UserRAReadFunc readFunc, void *priv);
250
261 static EDL_API IRAInputStreamPtr createRandomAccessFromNonRandomAccess(IEDLClassFactory *pFactory, const IInputStreamPtr &stream);
262
272 static EDL_API IRAInputStreamPtr createFromNewFileWithContents(IEDLClassFactory *pFactory, const EDLSysString &path, const IInputStreamPtr &stream);
273
283 static EDL_API IRAInputStreamPtr createFromNewFileWithContents(IEDLClassFactory *pFactory, const EDLString &path, const IInputStreamPtr &stream);
284
295 static EDL_API IInputStreamPtr createSubFile(IEDLClassFactory *pFactory, const IInputStreamPtr &stream, int64 offset, int64 length);
296
306 static EDL_API IInputStreamPtr createFromFlateCompressed(IEDLClassFactory *pFactory, const IInputStreamPtr &stream, bool raw = true, bool ignoreChecksums = false);
307
317 static EDL_API IInputStreamPtr createFromLz4Compressed(IEDLClassFactory *pFactory, const IInputStreamPtr &stream);
318
332 static EDL_API IInputStreamPtr createFromPredictorCompressed(IEDLClassFactory *pFactory, const IInputStreamPtr &stream,
333 uint8 predictor, uint8 colors, uint8 bitsPerComponent, uint32 columns);
334
342 static EDL_API IInputStreamPtr createCompositeStream(IEDLClassFactory *pFactory, const CIInputStreamVect &streams);
343
354 static EDL_API IInputPushbackStreamPtr createPushbackStream(IEDLClassFactory *pFactory, const IInputStreamPtr &sourceStream, bool clone = true);
355
370 static EDL_API IInputStreamPtr createUelStream(IEDLClassFactory *pFactory, const IInputStreamPtr &sourceStream);
371
385 static EDL_API IInputStreamPtr createTbcpStream(IEDLClassFactory *pFactory, const IInputStreamPtr &sourceStream, bool openSource = false);
386
411 static EDL_API IRAInputStreamPtr createBackgroundCopyStream(const EDL::ISessionPtr &session,
412 const IRAInputStreamPtr &sourceStream,
413 bool clonable = true);
414
426 static EDL_API IInputStreamPtr createBufferedStream(IEDLClassFactory *pFactory,
427 const IInputStreamPtr &sourceStream,
428 uint32 bufferSize = 4096);
429
430#ifdef SWIG
431#if SWIGJAVA
432 %apply char *BYTE {void *buffer}
433#endif
434#if SWIGCSHARP
435 %apply unsigned char OUTPUT[] {void *buffer}
436#endif
437#if SWIGPYTHON
438 %apply char INOUT[] {void *buffer};
439#endif
440#endif
441
449 virtual int32 read(void * buffer, int32 count) = 0;
450#ifdef SWIG
451 %clear void *buffer;
452#endif
453
458 virtual int8 read() = 0;
459
464 virtual bool eof() const = 0;
465
471 virtual int64 skip(int64 count)
472 {
473 static const int32 kBufSize = 1024;
474 char buf[kBufSize];
475 int64 rc = 0;
476 int32 n_read;
477 while (count > 0)
478 {
479 if ((n_read = read((void *)buf, (int32)((count > kBufSize)? kBufSize : count))) <= 0)
480 {
481 break;
482 }
483 else
484 {
485 rc += n_read;
486 }
487 count -= n_read;
488 }
489 return rc;
490 }
491
500 virtual bool getSourceFilePath(EDLSysString &sourcePath) = 0;
501
511 virtual bool getCanonicalSourceFilePath(EDLSysString &sourceCanonicalPath) = 0;
512
513 #ifdef SWIG
514#if SWIGJAVA
515 %apply char *BYTE {void *buffer}
516#endif
517#if SWIGCSHARP
518 %apply unsigned char OUTPUT[] {void *buffer}
519#endif
520#if SWIGPYTHON
521 %apply char INOUT[] {void *buffer}
522#endif
523#endif
530 virtual bool completeRead(void * buffer, int32 count);
531#ifdef SWIG
532 %clear void *buffer;
533#endif
534
535#ifdef SWIG
536#if SWIGJAVA
537 %apply char *BYTE {void *buffer}
538#endif
539#if SWIGCSHARP
540 %apply unsigned char OUTPUT[] {void *buffer}
541#endif
542#if SWIGPYTHON
543 %apply char INOUT[] {void *buffer}
544#endif
545#endif
551 virtual void completeReadE(void *buffer, int32 count);
552#ifdef SWIG
553 %clear void *buffer;
554#endif
555
556#ifdef SWIG
557 %apply unsigned long long &OUTPUT { uint64 &hash };
558#endif
567 virtual bool hash(uint64 &hash);
568#ifdef SWIG
569 %clear uint64 &hash;
570#endif
571};
572#define edlobj2IInputStream(src) edl_cast((IInputStream *)nullptr, src)
573
580
582{
583public:
587 virtual ~IRAStream ()
588 {}
589
594 virtual int64 length() = 0;
595
601 virtual bool setPos(int64 newPos) = 0;
602
607 virtual void setPosE(int64 newPos)
608 {
609 if (!setPos(newPos))
610 {
612 }
613 }
614};
615
625{
626 public:
631 {}
632
638 virtual bool pushBack(uint8 byte) = 0;
639
640#ifdef SWIG
641#if SWIGJAVA
642 %apply char *BYTE {const void *buffer}
643#endif
644#if SWIGCSHARP
645 %apply unsigned char INPUT[] {const void *buffer}
646#endif
647#if SWIGPYTHON
648 %apply char INPUT[] {const void *buffer}
649#endif
650#endif
657
658 virtual bool pushBack(const void *buffer, int32 count) = 0;
659#ifdef SWIG
660 %clear const void *buffer;
661#endif
662};
663
669class IRAInputStream : virtual public IInputStream, virtual public IRAStream
670{
671};
672
674#define edlobj2IRAInputStream(src) edl_cast((IRAInputStream *)nullptr, src)
675
681
682class IInputPushbackStream : virtual public IInputStream, virtual public IPushbackStream
683{
684};
685
686#define edlobj2IInputPushbackStream(src) edl_cast((IInputPushbackStream *)nullptr, src)
687
693
694class IRAInputPushbackStream : virtual public IRAInputStream, virtual public IPushbackStream
695{
696};
697
699#define edlobj2IRAInputPushbackStream(src) edl_cast((IRAInputPushbackStream *)nullptr, src)
700
701#define FILE_STREAM_GUID 0x89ad895, 0x48f1685b, 0x8dab9c1a, 0xe8e3b18b
702#define SHARED_STREAM_GUID 0xe88a727d, 0xe53140da, 0x9bbff26d, 0x79a42d81
703#define OUTPUTFILE_STREAM_GUID 0x50a914fc, 0xe81446b9, 0x8e420d48, 0x09454eff
704#define OUTPUTUSER_STREAM_GUID 0x789AEE52, 0xD0384136, 0x8B4584B0, 0x942E55CA
705#define INPUTUSER_STREAM_GUID 0xd55cc022, 0xa6844749, 0x9414d265, 0xeeab7cea
706#define INPUTRAUSER_STREAM_GUID 0x9895EBEB, 0xe2654b86, 0xa527a102, 0x3c3d36cd
707#define INPUT_MEMORY_STREAM_GUID 0x26CAC8F2, 0x726A432c, 0xB8399237, 0xEA12D95F
708#define FILE_STREAM_WITH_CALLBACK_GUID 0X7FB63540, 0XC0684D87, 0XB513F53A, 0X4925CF1C
709
710#define USERINPUT_RASTREAM_GUID 0x776b2562, 0x87e141b0, 0xa3d4c121, 0xdf3588ba
711#define USEROUTPUT_STREAM_GUID 0x1d0a1b45, 0xb2694fd2, 0xa1b28077, 0xee815f6a
712
720typedef void (*FileStreamReadFunc) (void *pPriv, int64 pos, int32 len);
721
723{
724 public:
725 CFileStreamParams(const EDLSysString & sName, bool append = false) : m_sName(sName), m_bAppend(append) {}
726
729};
730
732{
733 public:
734 CFileStreamWithCallbackParams(const EDLSysString & sName, FileStreamReadFunc pReadFunc, void *pPriv) :
735 CFileStreamParams(sName),
736 m_pReadFunc(pReadFunc),
737 m_pPriv(pPriv)
738 {
739 }
740
742 void *m_pPriv;
743};
744
745// Forward declaration
746class ISession;
747
748
750{
751 public:
753 m_pWriteFunc(pWriteFunc), m_pPriv(pPriv)
754 {}
755
757 void *m_pPriv;
758};
759
761{
762 public:
764 m_pReadFunc(pReadFunc), m_pPriv(pPriv)
765 {}
766
768 void *m_pPriv;
769};
770
772{
773 public:
774 CRAUserStreamReadParams(UserRAReadFunc pReadFunc, int64 length, void *pPriv) :
775 m_pReadFunc(pReadFunc), m_pPriv(pPriv), m_length(length)
776 {}
777
779 void *m_pPriv;
781};
782
784{
785 public:
786 // If makeCopy is false and free is true, the memory input stream will take ownership of the memory
787 // (which must be able to be freed by free()).
788 // If makeCopy is true, then a copy is made and will be managed by the stream. In this case,
789 // free is ignored.
790#ifdef SWIG
791#if SWIGJAVA
792 %apply char *BYTE {const uint8 *mem}
793#endif
794#if SWIGCSHARP
795 %apply unsigned char INPUT[] {const uint8 *mem}
796#endif
797#if SWIGPYTHON
798 %apply char INPUT[] {const uint8 *mem}
799#endif
800#endif
801 CInputMemoryParams(const uint8 *mem, int32 length, bool makeCopy, bool free = true) : m_memory(mem), m_length(length), m_makeCopy(makeCopy), m_free(free) {}
802#ifdef SWIG
803 %clear const uint8 *mem;
804#endif
805
809 bool m_free; // Ignored if m_makeCopy is true
810};
811
812class IOutputStream;
814
820
821class IOutputStream : virtual public IEDLStream
822{
823 public:
834 static EDL_API IRAOutputStreamPtr createToFile(IEDLClassFactory *pFactory, const EDLSysString &path, bool append = false);
835
846 static EDL_API IRAOutputStreamPtr createToFile(IEDLClassFactory *pFactory, const EDLString &path, bool append = false);
847
856 static EDL_API IOutputStreamPtr createFromUserWriteFunc(IEDLClassFactory *pFactory, UserStreamWriteFunc writeFunc, void *priv);
857
868 static EDL_API IOutputStreamPtr createToFlateCompressed(IEDLClassFactory *pFactory, const IOutputStreamPtr &stream, uint32 compressionLevel, bool raw = true);
869
881 static EDL_API IOutputStreamPtr createToLz4Compressed(IEDLClassFactory *pFactory, const IOutputStreamPtr &stream, bool openSourceStream = true);
882
891 static EDL_API int64 copy(const IInputStreamPtr &inStream, const IOutputStreamPtr &outStream);
892
893#ifdef SWIG
894#if SWIGJAVA
895 %apply char *BYTE {const void *buffer}
896#endif
897#if SWIGCSHARP
898 %apply unsigned char INPUT[] {const void *buffer}
899#endif
900#if SWIGPYTHON
901 %apply char INPUT[] {const void *buffer}
902#endif
903#endif
904
911 virtual int32 write(const void *buffer, int32 count) = 0;
912#ifdef SWIG
913 %clear const void *buffer;
914#endif
915
916#ifdef SWIG
917#if SWIGJAVA
918 %apply char *BYTE { const void *buffer }
919#endif
920#if SWIGCSHARP
921 %apply unsigned char INPUT[] { const void *buffer }
922#endif
923#if SWIGPYTHON
924 %apply char INPUT[] { const void *buffer }
925#endif
926#endif
927
934 virtual int32 writeE(const void *buffer, int32 count);
935#ifdef SWIG
936 %clear const void *buffer;
937#endif
938
947 static EDL_API int64 writeStream(const IInputStreamPtr &inStream, const IOutputStreamPtr &outStream);
948
955 virtual int32 write(const char *str);
956
962 virtual int32 writeE(const char *str);
963
968 virtual bool flush() = 0;
969
977 virtual int32 writeFormatted(const char *fmt, ...);
978
985 virtual int32 writeFormattedE(const char *fmt, ...);
986
987#ifdef SWIG
988#if SWIGJAVA
989 %apply char *BYTE {const void *buffer}
990#endif
991#if SWIGCSHARP
992 %apply unsigned char INPUT[] {const void *buffer}
993#endif
994#if SWIGPYTHON
995 %apply char INPUT[] {const void *buffer}
996#endif
997#endif
998
1006 virtual bool completeWrite(const void * buffer, int32 count);
1007#ifdef SWIG
1008 %clear const void *buffer;
1009#endif
1010
1017 virtual bool completeWrite(const char *str);
1018
1019#ifdef SWIG
1020#if SWIGJAVA
1021 %apply char *BYTE {const void *buffer}
1022#endif
1023#if SWIGCSHARP
1024 %apply unsigned char INPUT[] {const void *buffer}
1025#endif
1026#if SWIGPYTHON
1027 %apply char INPUT[] {const void *buffer}
1028#endif
1029#endif
1035 virtual void completeWriteE(const void *buffer, int32 count);
1036#ifdef SWIG
1037 %clear const void *buffer;
1038#endif
1039
1044 virtual void completeWriteE(const char *str);
1045
1049 virtual void flushE();
1050};
1051#define edlobj2IOutputStream(src) edl_cast((IOutputStream *)nullptr, src)
1052
1058
1059class IRAOutputStream : public IOutputStream, virtual public IRAStream
1060{
1061};
1062
1063#define edlobj2IRAOutputStream(src) edl_cast((IRAOutputStream *)nullptr, src)
1064
1066{
1067};
1068
1070#define edlobj2IRAInputOutputStream(src) edl_cast((IRAInputOutputStream *)nullptr, src)
1071
1077class EDLIFStream : public std::ifstream
1078{
1079 public:
1080 EDLIFStream() : std::ifstream() {}
1081 explicit EDLIFStream(const char* filename, std::ios_base::openmode mode = std::ios_base::in) : std::ifstream()
1082 {
1083 open(filename, mode);
1084 }
1085#ifdef _WIN32
1086 void open(const char* filename, std::ios_base::openmode mode = std::ios_base::in)
1087 {
1088 EDLString wFilename = EDLSysStringToEDLString(EDLSysString(filename));
1089 std::ifstream::open(wFilename.c_str(), mode);
1090 }
1091#endif
1092};
1093
1099class EDLOFStream : public std::ofstream
1100{
1101 public:
1102 EDLOFStream() : std::ofstream() {}
1103 explicit EDLOFStream(const char* filename, std::ios_base::openmode mode = std::ios_base::out) : std::ofstream()
1104 {
1105 open(filename, mode);
1106 }
1107#ifdef _WIN32
1108 void open(const char* filename, std::ios_base::openmode mode = std::ios_base::out)
1109 {
1110 EDLString wFilename = EDLSysStringToEDLString(EDLSysString(filename));
1111 std::ofstream::open(wFilename.c_str(), mode);
1112 }
1113#endif
1114};
1115
1117
1118#endif /* EDLSTREAM_H */
EDL Object Interface.
Definition iedlobject.h:31
Definition edlvector.h:30
bool m_bAppend
Definition edlstream.h:728
EDLSysString m_sName
Definition edlstream.h:727
CFileStreamParams(const EDLSysString &sName, bool append=false)
Definition edlstream.h:725
void * m_pPriv
Definition edlstream.h:742
FileStreamReadFunc m_pReadFunc
Definition edlstream.h:741
CFileStreamWithCallbackParams(const EDLSysString &sName, FileStreamReadFunc pReadFunc, void *pPriv)
Definition edlstream.h:734
bool m_free
Definition edlstream.h:809
const uint8 * m_memory
Definition edlstream.h:806
int32 m_length
Definition edlstream.h:807
bool m_makeCopy
Definition edlstream.h:808
CInputMemoryParams(const uint8 *mem, int32 length, bool makeCopy, bool free=true)
Definition edlstream.h:801
int64 m_length
Definition edlstream.h:780
void * m_pPriv
Definition edlstream.h:779
CRAUserStreamReadParams(UserRAReadFunc pReadFunc, int64 length, void *pPriv)
Definition edlstream.h:774
UserRAReadFunc m_pReadFunc
Definition edlstream.h:778
UserStreamReadFunc m_pReadFunc
Definition edlstream.h:767
void * m_pPriv
Definition edlstream.h:768
CUserStreamReadParams(UserStreamReadFunc pReadFunc, void *pPriv)
Definition edlstream.h:763
UserStreamWriteFunc m_pWriteFunc
Definition edlstream.h:756
CUserStreamWriteParams(UserStreamWriteFunc pWriteFunc, void *pPriv)
Definition edlstream.h:752
void * m_pPriv
Definition edlstream.h:757
EDLIFStream(const char *filename, std::ios_base::openmode mode=std::ios_base::in)
Definition edlstream.h:1081
EDLIFStream()
Definition edlstream.h:1080
EDLOFStream(const char *filename, std::ios_base::openmode mode=std::ios_base::out)
Definition edlstream.h:1103
EDLOFStream()
Definition edlstream.h:1102
Abstract interface for objects that can be hashed.
Definition idomhashable.h:28
EDL Factory Interface allows one part of the EDL infrastructure to register class creation methods id...
Definition iedlfactory.h:31
An abstract class for EDL exceptions.
Definition edlerrors.h:228
virtual uint32 getErrorCode() const =0
IEDLObject is an abstract base class that is used by all classes that are intended to be created via ...
Definition iedlobject.h:53
virtual bool clone(IEDLObjectPtr &ptrObject, IEDLClassFactory *pFactory)
Create a copy of EDLObject.
Definition iedlobject.h:82
Generic stream. Abstract base class for EDL stream subsystem.
Definition edlstream.h:39
virtual bool open()
Opens the stream.
Definition edlstream.h:51
virtual int64 getPos()=0
Get current stream position.
virtual bool isValid() const =0
Determine stream validity.
virtual void openE()=0
As per open(), but will throw an exception on failure (IEDLError) that for some stream types may cont...
virtual void close()=0
Closes the stream.
Input Stream with pushback support.
Definition edlstream.h:683
Generic input stream. Abstract base class for all input streams.
Definition edlstream.h:150
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 Langua...
static EDL_API IRAInputStreamPtr createSharedFromStream(IEDLClassFactory *pFactory, const IRAInputStreamPtr &stream, bool clone=true)
Creation function for a shared stream overlaying an existing stream. If this stream is cloned,...
virtual bool hash(uint64 &hash)
Obtain a 64-bit hash of the stream. Please note that this requires reading the stream and is therefor...
virtual bool completeRead(void *buffer, int32 count)
Perform a complete read.
static EDL_API IRAInputStreamPtr createFromFileShared(IEDLClassFactory *pFactory, const EDLString &path)
Creation function for an IInputStream for a file on disk. Similar to createFromFile,...
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 str...
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 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.
virtual bool getSourceFilePath(EDLSysString &sourcePath)=0
If available, find the file path of the file that this stream references, or for streams that take th...
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....
static EDL_API IInputStreamPtr createFromLz4Compressed(IEDLClassFactory *pFactory, const IInputStreamPtr &stream)
Creation routine for a input stream for decompressing an lz4 block compressed stream....
virtual int32 read(void *buffer, int32 count)=0
Read specified number of bytes from a stream into buffer.
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 ...
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....
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 ...
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....
static EDL_API IInputStreamPtr createBufferedStream(IEDLClassFactory *pFactory, const IInputStreamPtr &sourceStream, uint32 bufferSize=4096)
Creation routine for a stream that performs reads from an underlying stream, with buffering....
virtual bool eof() const =0
Determine if the stream has exhausted.
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 o...
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.
virtual void completeReadE(void *buffer, int32 count)
As completeRead(), but throws an exception if the operation fails.
virtual bool getCanonicalSourceFilePath(EDLSysString &sourceCanonicalPath)=0
If available, find the canonical file path of the file that this stream references,...
virtual int64 skip(int64 count)
Skip a specified number of bytes.
Definition edlstream.h:471
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 str...
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 ...
virtual int8 read()=0
Read single byte from a stream.
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 ex...
static EDL_API IRAInputStreamPtr createBackgroundCopyStream(const EDL::ISessionPtr &session, const IRAInputStreamPtr &sourceStream, bool clonable=true)
Creation routine for a stream that, in the background, copies the contents of an input stream into th...
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....
static EDL_API IRAInputStreamPtr createFromFileShared(IEDLClassFactory *pFactory, const EDLSysString &path)
Creation function for an IInputStream for a file on disk. Similar to createFromFile,...
Generic output stream. Abstract base class for output streams.
Definition edlstream.h:822
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 o...
virtual int32 writeE(const void *buffer, int32 count)
Perform a write, throwing an exception on failure.
virtual void flushE()
As flush(), but throws an exception if the operation fails.
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...
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 e...
virtual int32 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 void completeWriteE(const void *buffer, int32 count)
As completeWrite(), but throws an exception if the operation fails.
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.
virtual bool flush()=0
Flush the given stream.
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,...
virtual int32 write(const void *buffer, int32 count)=0
Perform a write.
virtual void completeWriteE(const char *str)
As completeWrite(), but throws an exception if the operation fails.
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....
virtual bool completeWrite(const char *str)
Perform a complete write.
virtual int32 writeE(const char *str)
Perform a write, throwing an exception on failure.
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.
virtual int32 write(const char *str)
Perform a write.
virtual int32 writeFormatted(const char *fmt,...)
Perform a formatted write as per fprintf().
Abstract base class (for input streams only) that provides a "push back" mechanism....
Definition edlstream.h:625
virtual bool pushBack(uint8 byte)=0
Push back a byte.
virtual bool pushBack(const void *buffer, int32 count)=0
Push back from a buffer.
virtual ~IPushbackStream()
Virtual destructor.
Definition edlstream.h:630
Definition edlstream.h:1066
Random-access Input Stream with pushback support.
Definition edlstream.h:695
Random Access Input Stream.
Definition edlstream.h:670
Random Access Output Stream.
Definition edlstream.h:1060
Abstract base class for "Random-Access" streams i.e. streams that can be arbitrarily re-positioned.
Definition edlstream.h:582
virtual void setPosE(int64 newPos)
Set stream position, but throw an exception on failure.
Definition edlstream.h:607
virtual ~IRAStream()
Virtual destructor.
Definition edlstream.h:587
virtual bool setPos(int64 newPos)=0
Set stream position.
virtual int64 length()=0
Get length of the stream.
EDL session class.
Definition isession.h:21
EDL_API void throwEDLError(uint32 errorcode)
Utility - Throw an IEDLError exception with the given error code.
#define _BEGIN_EDL_NAMESPACE
Definition edlnamespaces.h:75
#define _END_EDL_NAMESPACE
Definition edlnamespaces.h:76
void(* FileStreamReadFunc)(void *pPriv, int64 pos, int32 len)
Callback typedef for CFileStreamWithCallback that is used to notify a client of reads from stream.
Definition edlstream.h:720
int(* UserRAReadFunc)(void *pPriv, void *pBuff, int64 offset, int32 length)
Callback typedef for user defined random access input.
Definition edlstream.h:141
CEDLVector< IInputStreamPtr > CIInputStreamVect
Definition edlstream.h:90
int(* UserStreamWriteFunc)(void *pPriv, void *pBuff, unsigned int len)
Type definition of a callback function to receive streamed output.
Definition edlstream.h:113
int(* UserStreamReadFunc)(void *pPriv, void *pBuff, unsigned int len, unsigned int *pLenRead, int *pEof)
Callback typedef for streaming input.
Definition edlstream.h:126
CEDLVector< IRAInputStreamPtr > CIRAInputStreamVect
Definition edlstream.h:93
std::string EDLSysString
Definition edlstring.h:158
std::wstring EDLString
Definition edlstring.h:165
EDL_API EDLString EDLSysStringToEDLString(const EDLSysString &edlSysString)
EDLSysStringToEDLString converts an EDLSysString (UTF8) to an EDLString (UTF16 or UTF32 depending on ...
EDL "standard" types including known bit-length signed and unsigned integer type[def]s and definition...
unsigned int uint32
Definition edltypes.h:34
#define EDL_API
Definition edltypes.h:86
_BEGIN_HQN_NAMESPACE typedef signed char int8
Definition edltypes.h:27
unsigned long long uint64
Definition edltypes.h:35
signed int int32
Definition edltypes.h:29
signed long long int64
Definition edltypes.h:30
unsigned char uint8
Definition edltypes.h:32
Simple template vector class for general use.
@ EDL_ERR_IOERROR
General IO error.
Definition edlerrors.h:39
@ EDL_ERR_PANIC
Unstable state - abort the application.
Definition edlerrors.h:29
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211