Mako 8.2.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
edlstream.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2007-2025 Global Graphics Software Ltd. All rights reserved.
3 */
4
12
13#ifndef EDLSTREAM_H
14#define EDLSTREAM_H
15
16#include <fstream>
17#include <edl/edltypes.h>
18#include <edl/edlstream.h>
19#include <edl/iedlobject.h>
20#include <edl/idomhashable.h>
21#include <edl/edlvector.h>
22#include <edl/edlerrors.h>
23#include <edl/edlfwd.h>
24
25#ifdef _WIN32
26#include <stdarg.h>
27#endif
28
30
36
37class IEDLStream : virtual public IEDLObject
38{
39 public:
44 virtual bool isValid() const = 0;
45
50 virtual bool open()
51 {
52 try
53 {
54 openE();
55 return true;
56 }
57 catch (IEDLError &e)
58 {
59 if (e.getErrorCode() == EDL_ERR_PANIC)
60 {
61 throw;
62 }
63 return false;
64 }
65 }
66
71 virtual void openE() = 0;
72
76 virtual void close() = 0;
77
82 virtual int64 getPos() = 0;
83};
85#define edlobj2IEDLStream(src) edl_cast((IEDLStream *)NULL, src)
86
87class IInputStream;
90class IRAInputStream;
93class IRAOutputStream;
97
112typedef int (*UserStreamWriteFunc) (void *pPriv, void *pBuff, unsigned int len);
113
125typedef int (*UserStreamReadFunc) (void *pPriv, void *pBuff, unsigned int len,
126 unsigned int *pLenRead, int *pEof);
127
140typedef int (*UserRAReadFunc) (void *pPriv, void *pBuff, int64 offset, int32 length);
141
147
148class IInputStream : virtual public IEDLStream, virtual public IDOMHashable
149{
150 public:
158 static EDL_API IRAInputStreamPtr createFromFile(IEDLClassFactory *pFactory, const EDLSysString &path);
159
167 static EDL_API IRAInputStreamPtr createFromFile(IEDLClassFactory *pFactory, const EDLString &path);
168
182 static EDL_API IRAInputStreamPtr createFromFileShared(IEDLClassFactory *pFactory, const EDLSysString &path);
183
197 static EDL_API IRAInputStreamPtr createFromFileShared(IEDLClassFactory *pFactory, const EDLString &path);
198
213 static EDL_API IRAInputStreamPtr createSharedFromStream(IEDLClassFactory *pFactory, const IRAInputStreamPtr &stream, bool clone = true);
214
227 static EDL_API IRAInputStreamPtr createFromMemory(IEDLClassFactory *pFactory, const void *mem, uint32 length, bool copy = false, bool free = true);
228
237 static EDL_API IInputStreamPtr createFromUserReadFunc(IEDLClassFactory *pFactory, UserStreamReadFunc readFunc, void *priv);
238
248 static EDL_API IRAInputStreamPtr createFromRAUserFunc(IEDLClassFactory *pFactory, int64 length, UserRAReadFunc readFunc, void *priv);
249
260 static EDL_API IRAInputStreamPtr createRandomAccessFromNonRandomAccess(IEDLClassFactory *pFactory, const IInputStreamPtr &stream);
261
271 static EDL_API IRAInputStreamPtr createFromNewFileWithContents(IEDLClassFactory *pFactory, const EDLSysString &path, const IInputStreamPtr &stream);
272
282 static EDL_API IRAInputStreamPtr createFromNewFileWithContents(IEDLClassFactory *pFactory, const EDLString &path, const IInputStreamPtr &stream);
283
294 static EDL_API IInputStreamPtr createSubFile(IEDLClassFactory *pFactory, const IInputStreamPtr &stream, int64 offset, int64 length);
295
305 static EDL_API IInputStreamPtr createFromFlateCompressed(IEDLClassFactory *pFactory, const IInputStreamPtr &stream, bool raw = true, bool ignoreChecksums = false);
306
316 static EDL_API IInputStreamPtr createFromLz4Compressed(IEDLClassFactory *pFactory, const IInputStreamPtr &stream);
317
331 static EDL_API IInputStreamPtr createFromPredictorCompressed(IEDLClassFactory *pFactory, const IInputStreamPtr &stream,
332 uint8 predictor, uint8 colors, uint8 bitsPerComponent, uint32 columns);
333
341 static EDL_API IInputStreamPtr createCompositeStream(IEDLClassFactory *pFactory, const CIInputStreamVect &streams);
342
353 static EDL_API IInputPushbackStreamPtr createPushbackStream(IEDLClassFactory *pFactory, const IInputStreamPtr &sourceStream, bool clone = true);
354
369 static EDL_API IInputStreamPtr createUelStream(IEDLClassFactory *pFactory, const IInputStreamPtr &sourceStream);
370
384 static EDL_API IInputStreamPtr createTbcpStream(IEDLClassFactory *pFactory, const IInputStreamPtr &sourceStream, bool openSource = false);
385
410 static EDL_API IRAInputStreamPtr createBackgroundCopyStream(const EDL::ISessionPtr &session,
411 const IRAInputStreamPtr &sourceStream,
412 bool clonable = true);
413
414#ifdef SWIG
415#if SWIGJAVA
416 %apply char *BYTE {void *buffer}
417#endif
418#if SWIGCSHARP
419 %apply unsigned char OUTPUT[] {void *buffer}
420#endif
421#if SWIGPYTHON
422 %apply char INOUT[] {void *buffer};
423#endif
424#endif
425
433 virtual int32 read(void * buffer, int32 count) = 0;
434#ifdef SWIG
435 %clear void *buffer;
436#endif
437
442 virtual int8 read() = 0;
443
448 virtual bool eof() const = 0;
449
455 virtual int64 skip(int64 count)
456 {
457 static const int32 kBufSize = 1024;
458 char buf[kBufSize];
459 int64 rc = 0;
460 int32 n_read;
461 while (count > 0)
462 {
463 if ((n_read = read((void *)buf, (int32)((count > kBufSize)? kBufSize : count))) <= 0)
464 {
465 break;
466 }
467 else
468 {
469 rc += n_read;
470 }
471 count -= n_read;
472 }
473 return rc;
474 }
475
484 virtual bool getSourceFilePath(EDLSysString &sourcePath) = 0;
485
495 virtual bool getCanonicalSourceFilePath(EDLSysString &sourceCanonicalPath) = 0;
496
497 #ifdef SWIG
498#if SWIGJAVA
499 %apply char *BYTE {void *buffer}
500#endif
501#if SWIGCSHARP
502 %apply unsigned char OUTPUT[] {void *buffer}
503#endif
504#if SWIGPYTHON
505 %apply char INOUT[] {void *buffer}
506#endif
507#endif
514 virtual bool completeRead(void * buffer, int32 count);
515#ifdef SWIG
516 %clear void *buffer;
517#endif
518
519#ifdef SWIG
520#if SWIGJAVA
521 %apply char *BYTE {void *buffer}
522#endif
523#if SWIGCSHARP
524 %apply unsigned char OUTPUT[] {void *buffer}
525#endif
526#if SWIGPYTHON
527 %apply char INOUT[] {void *buffer}
528#endif
529#endif
535 virtual void completeReadE(void *buffer, int32 count);
536#ifdef SWIG
537 %clear void *buffer;
538#endif
539
540#ifdef SWIG
541#if SWIGJAVA
542 %apply uint64_t &OUTPUT {uint64 &hash };
543#endif
544#if SWIGCSHARP
545 %apply uint64_t &OUTPUT {uint64 &hash };
546#endif
547#endif
556 virtual bool hash(uint64 &hash);
557#ifdef SWIG
558 %clear uint64 &hash;
559#endif
560};
561#define edlobj2IInputStream(src) edl_cast((IInputStream *)NULL, src)
562
569
571{
572public:
576 virtual ~IRAStream ()
577 {}
578
583 virtual int64 length() = 0;
584
590 virtual bool setPos(int64 newPos) = 0;
591
596 virtual void setPosE(int64 newPos)
597 {
598 if (!setPos(newPos))
599 {
601 }
602 }
603};
604
614{
615 public:
620 {}
621
627 virtual bool pushBack(uint8 byte) = 0;
628
629#ifdef SWIG
630#if SWIGJAVA
631 %apply char *BYTE {const void *buffer}
632#endif
633#if SWIGCSHARP
634 %apply unsigned char INPUT[] {const void *buffer}
635#endif
636#if SWIGPYTHON
637 %apply char INPUT[] {const void *buffer}
638#endif
639#endif
646
647 virtual bool pushBack(const void *buffer, int32 count) = 0;
648#ifdef SWIG
649 %clear const void *buffer;
650#endif
651};
652
658class IRAInputStream : virtual public IInputStream, virtual public IRAStream
659{
660};
661
663#define edlobj2IRAInputStream(src) edl_cast((IRAInputStream *)NULL, src)
664
670
671class IInputPushbackStream : virtual public IInputStream, virtual public IPushbackStream
672{
673};
674
675#define edlobj2IInputPushbackStream(src) edl_cast((IInputPushbackStream *)NULL, src)
676
682
683class IRAInputPushbackStream : virtual public IRAInputStream, virtual public IPushbackStream
684{
685};
686
688#define edlobj2IRAInputPushbackStream(src) edl_cast((IRAInputPushbackStream *)NULL, src)
689
690#define FILE_STREAM_GUID 0x89ad895, 0x48f1685b, 0x8dab9c1a, 0xe8e3b18b
691#define SHARED_STREAM_GUID 0xe88a727d, 0xe53140da, 0x9bbff26d, 0x79a42d81
692#define OUTPUTFILE_STREAM_GUID 0x50a914fc, 0xe81446b9, 0x8e420d48, 0x09454eff
693#define OUTPUTUSER_STREAM_GUID 0x789AEE52, 0xD0384136, 0x8B4584B0, 0x942E55CA
694#define INPUTUSER_STREAM_GUID 0xd55cc022, 0xa6844749, 0x9414d265, 0xeeab7cea
695#define INPUTRAUSER_STREAM_GUID 0x9895EBEB, 0xe2654b86, 0xa527a102, 0x3c3d36cd
696#define INPUT_MEMORY_STREAM_GUID 0x26CAC8F2, 0x726A432c, 0xB8399237, 0xEA12D95F
697#define FILE_STREAM_WITH_CALLBACK_GUID 0X7FB63540, 0XC0684D87, 0XB513F53A, 0X4925CF1C
698
699#define USERINPUT_RASTREAM_GUID 0x776b2562, 0x87e141b0, 0xa3d4c121, 0xdf3588ba
700#define USEROUTPUT_STREAM_GUID 0x1d0a1b45, 0xb2694fd2, 0xa1b28077, 0xee815f6a
701
709typedef void (*FileStreamReadFunc) (void *pPriv, int64 pos, int32 len);
710
712{
713 public:
714 CFileStreamParams(const EDLSysString & sName, bool append = false) : m_sName(sName), m_bAppend(append) {}
715
718};
719
721{
722 public:
723 CFileStreamWithCallbackParams(const EDLSysString & sName, FileStreamReadFunc pReadFunc, void *pPriv) :
724 CFileStreamParams(sName),
725 m_pReadFunc(pReadFunc),
726 m_pPriv(pPriv)
727 {
728 }
729
731 void *m_pPriv;
732};
733
734// Forward declaration
735class ISession;
736
737
739{
740 public:
742 m_pWriteFunc(pWriteFunc), m_pPriv(pPriv)
743 {}
744
746 void *m_pPriv;
747};
748
750{
751 public:
753 m_pReadFunc(pReadFunc), m_pPriv(pPriv)
754 {}
755
757 void *m_pPriv;
758};
759
761{
762 public:
763 CRAUserStreamReadParams(UserRAReadFunc pReadFunc, int64 length, void *pPriv) :
764 m_pReadFunc(pReadFunc), m_pPriv(pPriv), m_length(length)
765 {}
766
768 void *m_pPriv;
770};
771
773{
774 public:
775 // If makeCopy is false and free is true, the memory input stream will take ownership of the memory
776 // (which must be able to be freed by free()).
777 // If makeCopy is true, then a copy is made and will be managed by the stream. In this case,
778 // free is ignored.
779#ifdef SWIG
780#if SWIGJAVA
781 %apply char *BYTE {const uint8 *mem}
782#endif
783#if SWIGCSHARP
784 %apply unsigned char INPUT[] {const uint8 *mem}
785#endif
786#if SWIGPYTHON
787 %apply char INPUT[] {const uint8 *mem}
788#endif
789#endif
790 CInputMemoryParams(const uint8 *mem, int32 length, bool makeCopy, bool free = true) : m_memory(mem), m_length(length), m_makeCopy(makeCopy), m_free(free) {}
791#ifdef SWIG
792 %clear const uint8 *mem;
793#endif
794
798 bool m_free; // Ignored if m_makeCopy is true
799};
800
801class IOutputStream;
803
809
810class IOutputStream : virtual public IEDLStream
811{
812 public:
823 static EDL_API IRAOutputStreamPtr createToFile(IEDLClassFactory *pFactory, const EDLSysString &path, bool append = false);
824
835 static EDL_API IRAOutputStreamPtr createToFile(IEDLClassFactory *pFactory, const EDLString &path, bool append = false);
836
845 static EDL_API IOutputStreamPtr createFromUserWriteFunc(IEDLClassFactory *pFactory, UserStreamWriteFunc writeFunc, void *priv);
846
857 static EDL_API IOutputStreamPtr createToFlateCompressed(IEDLClassFactory *pFactory, const IOutputStreamPtr &stream, uint32 compressionLevel, bool raw = true);
858
870 static EDL_API IOutputStreamPtr createToLz4Compressed(IEDLClassFactory *pFactory, const IOutputStreamPtr &stream, bool openSourceStream = true);
871
880 static EDL_API int64 copy(const IInputStreamPtr &inStream, const IOutputStreamPtr &outStream);
881
882#ifdef SWIG
883#if SWIGJAVA
884 %apply char *BYTE {const void *buffer}
885#endif
886#if SWIGCSHARP
887 %apply unsigned char INPUT[] {const void *buffer}
888#endif
889#if SWIGPYTHON
890 %apply char INPUT[] {const void *buffer}
891#endif
892#endif
893 virtual int32 write(const void *buffer, int32 count) = 0;
894#ifdef SWIG
895 %clear const void *buffer;
896#endif
897
906 static EDL_API int64 writeStream(const IInputStreamPtr &inStream, const IOutputStreamPtr &outStream);
907
914 virtual int32 write(const char *str)
915 {
916 return this->write(str, (int32) strlen(str));
917 }
918
924 virtual void writeE(const char *str)
925 {
926 this->completeWriteE(str, (int32) strlen(str));
927 }
928
929 virtual bool flush() = 0;
930
938 virtual int32 writeFormatted(const char *fmt, ...);
939
945 virtual void writeFormattedE(const char *fmt, ...);
946
947#ifdef SWIG
948#if SWIGJAVA
949 %apply char *BYTE {const void *buffer}
950#endif
951#if SWIGCSHARP
952 %apply unsigned char INPUT[] {const void *buffer}
953#endif
954#if SWIGPYTHON
955 %apply char INPUT[] {const void *buffer}
956#endif
957#endif
958
966 virtual bool completeWrite(const void * buffer, int32 count);
967#ifdef SWIG
968 %clear const void *buffer;
969#endif
970
977 virtual bool completeWrite(const char *str)
978 {
979 return this->completeWrite(str, (int32) strlen(str));
980 }
981
982#ifdef SWIG
983#if SWIGJAVA
984 %apply char *BYTE {const void *buffer}
985#endif
986#if SWIGCSHARP
987 %apply unsigned char INPUT[] {const void *buffer}
988#endif
989#if SWIGPYTHON
990 %apply char INPUT[] {const void *buffer}
991#endif
992#endif
998 virtual void completeWriteE(const void *buffer, int32 count);
999#ifdef SWIG
1000 %clear const void *buffer;
1001#endif
1002
1007 virtual void completeWriteE(const char *str)
1008 {
1009 this->completeWriteE(str, (int32) strlen(str));
1010 }
1011};
1012#define edlobj2IOutputStream(src) edl_cast((IOutputStream *)NULL, src)
1013
1019
1020class IRAOutputStream : public IOutputStream, virtual public IRAStream
1021{
1022};
1023
1024#define edlobj2IRAOutputStream(src) edl_cast((IRAOutputStream *)NULL, src)
1025
1027{
1028};
1029
1031#define edlobj2IRAInputOutputStream(src) edl_cast((IRAInputOutputStream *)NULL, src)
1032
1038class EDLIFStream : public std::ifstream
1039{
1040 public:
1041 EDLIFStream() : std::ifstream() {}
1042 explicit EDLIFStream(const char* filename, std::ios_base::openmode mode = std::ios_base::in) : std::ifstream()
1043 {
1044 open(filename, mode);
1045 }
1046#ifdef _WIN32
1047 void open(const char* filename, std::ios_base::openmode mode = std::ios_base::in)
1048 {
1049 EDLString wFilename = EDLSysStringToEDLString(EDLSysString(filename));
1050 std::ifstream::open(wFilename.c_str(), mode);
1051 }
1052#endif
1053};
1054
1060class EDLOFStream : public std::ofstream
1061{
1062 public:
1063 EDLOFStream() : std::ofstream() {}
1064 explicit EDLOFStream(const char* filename, std::ios_base::openmode mode = std::ios_base::out) : std::ofstream()
1065 {
1066 open(filename, mode);
1067 }
1068#ifdef _WIN32
1069 void open(const char* filename, std::ios_base::openmode mode = std::ios_base::out)
1070 {
1071 EDLString wFilename = EDLSysStringToEDLString(EDLSysString(filename));
1072 std::ofstream::open(wFilename.c_str(), mode);
1073 }
1074#endif
1075};
1076
1078
1079#endif /* EDLSTREAM_H */
EDL Object Interface.
Definition iedlobject.h:31
Definition edlvector.h:30
bool m_bAppend
Definition edlstream.h:717
EDLSysString m_sName
Definition edlstream.h:716
CFileStreamParams(const EDLSysString &sName, bool append=false)
Definition edlstream.h:714
void * m_pPriv
Definition edlstream.h:731
FileStreamReadFunc m_pReadFunc
Definition edlstream.h:730
CFileStreamWithCallbackParams(const EDLSysString &sName, FileStreamReadFunc pReadFunc, void *pPriv)
Definition edlstream.h:723
bool m_free
Definition edlstream.h:798
const uint8 * m_memory
Definition edlstream.h:795
int32 m_length
Definition edlstream.h:796
bool m_makeCopy
Definition edlstream.h:797
CInputMemoryParams(const uint8 *mem, int32 length, bool makeCopy, bool free=true)
Definition edlstream.h:790
int64 m_length
Definition edlstream.h:769
void * m_pPriv
Definition edlstream.h:768
CRAUserStreamReadParams(UserRAReadFunc pReadFunc, int64 length, void *pPriv)
Definition edlstream.h:763
UserRAReadFunc m_pReadFunc
Definition edlstream.h:767
UserStreamReadFunc m_pReadFunc
Definition edlstream.h:756
void * m_pPriv
Definition edlstream.h:757
CUserStreamReadParams(UserStreamReadFunc pReadFunc, void *pPriv)
Definition edlstream.h:752
UserStreamWriteFunc m_pWriteFunc
Definition edlstream.h:745
CUserStreamWriteParams(UserStreamWriteFunc pWriteFunc, void *pPriv)
Definition edlstream.h:741
void * m_pPriv
Definition edlstream.h:746
EDLIFStream(const char *filename, std::ios_base::openmode mode=std::ios_base::in)
Definition edlstream.h:1042
EDLIFStream()
Definition edlstream.h:1041
EDLOFStream(const char *filename, std::ios_base::openmode mode=std::ios_base::out)
Definition edlstream.h:1064
EDLOFStream()
Definition edlstream.h:1063
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:222
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:38
virtual bool open()
Opens the stream.
Definition edlstream.h:50
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:672
Generic input stream. Abstract base class for all input streams.
Definition edlstream.h:149
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....
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:455
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:811
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 void writeFormattedE(const char *fmt,...)
As writeFormatted(), 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 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
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
virtual void completeWriteE(const char *str)
As completeWrite(), but throws an exception if the operation fails.
Definition edlstream.h:1007
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.
Definition edlstream.h:977
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.
Definition edlstream.h:914
virtual int32 writeFormatted(const char *fmt,...)
Perform a formatted write as per fprintf().
virtual void writeE(const char *str)
Perform a write, throwing an exception on failure.
Definition edlstream.h:924
Abstract base class (for input streams only) that provides a "push back" mechanism....
Definition edlstream.h:614
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:619
Definition edlstream.h:1027
Random-access Input Stream with pushback support.
Definition edlstream.h:684
Random Access Input Stream.
Definition edlstream.h:659
Random Access Output Stream.
Definition edlstream.h:1021
Abstract base class for "Random-Access" streams i.e. streams that can be arbitrarily re-positioned.
Definition edlstream.h:571
virtual void setPosE(int64 newPos)
Set stream position, but throw an exception on failure.
Definition edlstream.h:596
virtual ~IRAStream()
Virtual destructor.
Definition edlstream.h:576
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:709
int(* UserRAReadFunc)(void *pPriv, void *pBuff, int64 offset, int32 length)
Callback typedef for user defined random access input.
Definition edlstream.h:140
CEDLVector< IInputStreamPtr > CIInputStreamVect
Definition edlstream.h:89
int(* UserStreamWriteFunc)(void *pPriv, void *pBuff, unsigned int len)
Type definition of a callback function to receive streamed output.
Definition edlstream.h:112
int(* UserStreamReadFunc)(void *pPriv, void *pBuff, unsigned int len, unsigned int *pLenRead, int *pEof)
Callback typedef for streaming input.
Definition edlstream.h:125
CEDLVector< IRAInputStreamPtr > CIRAInputStreamVect
Definition edlstream.h:92
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:37
@ EDL_ERR_PANIC
Unstable state - abort the application.
Definition edlerrors.h:27
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211