15 #ifndef _StreamDataSource_h_ 16 #define _StreamDataSource_h_ 20 #include <utl/UtlString.h> 22 #include "os/OsStatus.h" 72 virtual OsStatus
open() = 0 ;
75 virtual OsStatus
close() = 0 ;
82 virtual OsStatus
read(
char *szBuffer,
int iLength,
int& iLengthRead) = 0;
89 virtual OsStatus
peek(
char* szBuffer,
int iLength,
int& iLengthRead) = 0;
106 virtual OsStatus
seek(
unsigned int iLocation) = 0 ;
123 virtual OsStatus
getLength(
int& iLength) = 0 ;
129 virtual OsStatus
toString(UtlString&
string) = 0 ;
145 #ifdef MP_STREAM_DEBUG 170 #endif // _StreamDataSource_h_ virtual OsStatus read(char *szBuffer, int iLength, int &iLengthRead)=0
An abstraction definition of a stream data source.
Definition: StreamDataSource.h:47
StreamDataSourceEvent
Definition: StreamDataSource.h:31
virtual OsStatus seek(unsigned int iLocation)=0
Moves the stream pointer to the an absolute location.
Definition: StreamDataSource.h:33
virtual OsStatus destroyAndDelete()=0
Destroys and deletes the data source object.
StreamDataSource(int iFlags=0)
Constructors a StreamDataSource given optional flags.
Definition: StreamDataSource.cpp:29
Definition: StreamDataSource.h:36
StreamDataSource & operator=(const StreamDataSource &rhs)
Assignment operator (not supported)
Definition: StreamDataSource.cpp:102
virtual OsStatus close()=0
Closes the data source.
int getFlags()
Gets the flags specified at time of construction.
Definition: StreamDataSource.cpp:63
Definition: StreamDataSource.h:35
virtual OsStatus getPosition(int &iPosition)=0
Gets the current position within the stream.
void fireEvent(StreamDataSourceEvent event)
Fires a data source event to the interested consumer.
Definition: StreamDataSource.cpp:116
Definition: StreamDataSourceListener.h:32
int miFlags
flags specified during construction
Definition: StreamDataSource.h:165
virtual OsStatus getLength(int &iLength)=0
Gets the length of the stream (if available)
virtual OsStatus interrupt()
Interrupts any time consuming operation.
Definition: StreamDataSource.cpp:45
void setListener(StreamDataSourceListener *pListener)
Definition: StreamDataSource.cpp:54
Definition: StreamDataSource.h:34
virtual OsStatus peek(char *szBuffer, int iLength, int &iLengthRead)=0
Identical to read, except the stream pointer is not advanced.
StreamDataSourceListener * mpListener
data source listener
Definition: StreamDataSource.h:164
virtual OsStatus open()=0
Opens the data source.
virtual OsStatus toString(UtlString &string)=0
Renders a string describing this data source.
virtual ~StreamDataSource()
Destructor.
Definition: StreamDataSource.cpp:37