IReader Class Reference
[C++ IOStream Fixups And Utilities]

Search Toolkit Book for IReader

#include <reader_writer.hpp>

Inheritance diagram for IReader:

Inheritance graph
[legend]
List of all members.

Detailed Description

A very basic data-read interface.

Definition at line 68 of file reader_writer.hpp.

Public Member Functions

virtual ERW_Result Read (void *buf, size_t count, size_t *bytes_read=0)=0
 Read as many as "count" bytes into a buffer pointed to by "buf" argument.
virtual ERW_Result PendingCount (size_t *count)=0
 Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from input device without blocking.
virtual ~IReader ()


Constructor & Destructor Documentation

virtual IReader::~IReader  )  [inline, virtual]
 

Definition at line 91 of file reader_writer.hpp.


Member Function Documentation

virtual ERW_Result IReader::PendingCount size_t *  count  )  [pure virtual]
 

Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from input device without blocking.

Return eRW_Success if the number of pending bytes has been stored at the location pointed to by "count". Return eRW_NotImplemented if the number cannot be determined. Otherwise, return other eRW_... condition to reflect the problem. Note that if reporting 0 bytes ready, the method may return either both eRW_Success and zero *count, or return eRW_NotImplemented alone.

Implemented in CCgiEntryReader, CSocketReaderWriter, CStringOrBlobStorageReader, CFileReader, CFileReaderWriter, CStreamReader, CStringReader, CBDB_BlobReaderWriter, CBlobReader, CNlmZipReader, CTransmissionReader, CDB_Result_Reader, CCGIStreamReader, CNetCacheReader, CBDB_CacheIReader, CDBAPI_CacheIReader, CxBlobReader, and CTarReader.

Referenced by CTransmissionReader::PendingCount(), and CRWStreambuf::showmanyc().

virtual ERW_Result IReader::Read void *  buf,
size_t  count,
size_t *  bytes_read = 0
[pure virtual]
 

Read as many as "count" bytes into a buffer pointed to by "buf" argument.

Store the number of bytes actually read, or 0 on EOF or error, via the pointer "bytes_read", if provided. Special case: if "count" passed as 0, then the value of "buf" is ignored, and the return value is always eRW_Success, but no change should be actually made to the state of input device.

Implemented in CCgiEntryReader, CSocketReaderWriter, CStringOrBlobStorageReader, CFileReader, CFileReaderWriter, CStreamReader, CStringReader, CBDB_BlobReaderWriter, CBlobReader, CNlmZipReader, CTransmissionReader, CDB_Result_Reader, CCGIStreamReader, CNetCacheReader, CBDB_CacheIReader, CDBAPI_CacheIReader, CxBlobReader, and CTarReader.

Referenced by CTransmissionReader::Read(), CNlmZipReader::Read(), CIRByteSourceReader::Read(), SNetCacheAPIImpl::ReadBuffer(), CRWStreambuf::underflow(), CNlmZipReader::x_Read(), CTransmissionReader::x_ReadRepeated(), CNlmZipReader::x_ReadZipHeader(), and CRWStreambuf::xsgetn().


The documentation for this class was generated from the following file:
Generated on Mon Dec 7 15:38:30 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:26 2009 by modify_doxy.py rev. 173732