Public Member Functions | |
DcmFileProducer (const char *filename, Uint32 offset=0) | |
constructor | |
virtual | ~DcmFileProducer () |
destructor | |
virtual OFBool | good () const |
returns the status of the producer. | |
virtual OFCondition | status () const |
returns the status of the producer as an OFCondition object. | |
virtual OFBool | eos () const |
returns true if the producer is at the end of stream. | |
virtual Uint32 | avail () const |
returns the minimum number of bytes that can be read with the next call to read(). | |
virtual Uint32 | read (void *buf, Uint32 buflen) |
reads as many bytes as possible into the given block. | |
virtual Uint32 | skip (Uint32 skiplen) |
skips over the given number of bytes (or less) | |
virtual void | putback (Uint32 num) |
resets the stream to the position by the given number of bytes. | |
Private Member Functions | |
DcmFileProducer (const DcmFileProducer &) | |
private unimplemented copy constructor | |
DcmFileProducer & | operator= (const DcmFileProducer &) |
private unimplemented copy assignment operator | |
Private Attributes | |
FILE * | file_ |
the file we're actually reading from | |
OFCondition | status_ |
status | |
Uint32 | size_ |
number of bytes in file |
Definition at line 47 of file dcistrmf.h.
DcmFileProducer::DcmFileProducer | ( | const char * | filename, | |
Uint32 | offset = 0 | |||
) |
constructor
filename | name of file to be opened, must not be NULL or empty | |
offset | byte offset to skip from the start of file |
virtual OFBool DcmFileProducer::good | ( | ) | const [virtual] |
returns the status of the producer.
Unless the status is good, the producer will not permit any operation.
Implements DcmProducer.
virtual OFCondition DcmFileProducer::status | ( | ) | const [virtual] |
returns the status of the producer as an OFCondition object.
Unless the status is good, the producer will not permit any operation.
Implements DcmProducer.
virtual OFBool DcmFileProducer::eos | ( | ) | const [virtual] |
returns true if the producer is at the end of stream.
Implements DcmProducer.
virtual Uint32 DcmFileProducer::avail | ( | ) | const [virtual] |
returns the minimum number of bytes that can be read with the next call to read().
The DcmObject read methods rely on avail to return a value > 0 if there is no I/O suspension since certain data such as tag and length are only read "en bloc", i.e. all or nothing.
Implements DcmProducer.
virtual Uint32 DcmFileProducer::read | ( | void * | buf, | |
Uint32 | buflen | |||
) | [virtual] |
reads as many bytes as possible into the given block.
buf | pointer to memory block, must not be NULL | |
buflen | length of memory block |
Implements DcmProducer.
virtual Uint32 DcmFileProducer::skip | ( | Uint32 | skiplen | ) | [virtual] |
skips over the given number of bytes (or less)
skiplen | number of bytes to skip |
Implements DcmProducer.
virtual void DcmFileProducer::putback | ( | Uint32 | num | ) | [virtual] |
resets the stream to the position by the given number of bytes.
num | number of bytes to putback. If the putback operation fails, the producer status becomes bad. |
Implements DcmProducer.