33 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/dcmdata/dcistrma.h"
54 virtual OFBool
good()
const;
74 virtual offile_off_t
avail();
81 virtual offile_off_t
read(
void *buf, offile_off_t buflen);
87 virtual offile_off_t
skip(offile_off_t skiplen);
93 virtual void putback(offile_off_t num);
100 virtual void setBuffer(
const void *buf, offile_off_t buflen);
179 virtual void setBuffer(
const void *buf, offile_off_t buflen);
virtual offile_off_t skip(offile_off_t skiplen)
skips over the given number of bytes (or less)
OFCondition status_
status
virtual void setEos()
marks the end of stream, i.e.
DcmBufferProducer & operator=(const DcmBufferProducer &)
private unimplemented copy assignment operator
offile_off_t bufSize_
size of the user buffer, in bytes
unsigned char * buffer_
the user buffer we're actually reading from
unsigned char * backup_
the backup buffer
virtual void putback(offile_off_t num)
resets the stream to the position by the given number of bytes.
virtual offile_off_t avail()
returns the minimum number of bytes that can be read with the next call to read().
DcmBufferProducer()
constructor
producer class that reads data from a buffer provided by the caller.
virtual ~DcmBufferProducer()
destructor
offile_off_t backupStart_
index of first valid byte in backup buffer, for putback
virtual OFBool eos()
returns true if the producer is at the end of stream.
virtual void releaseBuffer()
releases the current buffer.
virtual void setBuffer(const void *buf, offile_off_t buflen)
adds the content of the given buffer to the input stream.
virtual OFCondition status() const
returns the status of the producer as an OFCondition object.
OFBool eosflag_
true if setEos has been called before
virtual OFBool good() const
returns the status of the producer.
offile_off_t backupIndex_
number of bytes read from the backup buffer
pure virtual abstract base class for producers, i.e.
offile_off_t bufIndex_
number of bytes read from the user buffer
virtual offile_off_t read(void *buf, offile_off_t buflen)
reads as many bytes as possible into the given block.
General purpose class for condition codes.