2001-10-06 14:13:28 +00:00
|
|
|
#ifndef IINPUTSTREAM_H
|
|
|
|
#define IINPUTSTREAM_H
|
|
|
|
|
|
|
|
#include "IInterface.h"
|
|
|
|
#include "BasicTypes.h"
|
|
|
|
|
|
|
|
class IInputStream : public IInterface {
|
2002-04-29 14:40:01 +00:00
|
|
|
public:
|
2001-10-06 14:13:28 +00:00
|
|
|
// manipulators
|
|
|
|
|
|
|
|
// close the stream
|
2001-10-14 16:58:01 +00:00
|
|
|
virtual void close() = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
|
|
|
// read up to maxCount bytes into buffer, return number read.
|
|
|
|
// blocks if no data is currently available. if buffer is NULL
|
2002-06-26 16:31:48 +00:00
|
|
|
// then the data is discarded. returns (UInt32)-1 if there's
|
|
|
|
// no data for timeout seconds; if timeout < 0 then it blocks
|
|
|
|
// until data is available.
|
|
|
|
// (cancellation point)
|
|
|
|
virtual UInt32 read(void* buffer, UInt32 maxCount, double timeout) = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
|
|
|
// accessors
|
|
|
|
|
|
|
|
// get a conservative estimate of the available bytes to read
|
|
|
|
// (i.e. a number not greater than the actual number of bytes).
|
|
|
|
// some streams may not be able to determine this and will always
|
|
|
|
// return zero.
|
2001-10-14 16:58:01 +00:00
|
|
|
virtual UInt32 getSize() const = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|