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

Search Toolkit Book for CStreamReader

#include <rwstream.hpp>

Inheritance diagram for CStreamReader:

Inheritance graph
[legend]
Collaboration diagram for CStreamReader:

Collaboration graph
[legend]
List of all members.

Detailed Description

istream based IReader

Definition at line 185 of file rwstream.hpp.

Public Member Functions

 CStreamReader (CNcbiIstream &is, EOwnership own=eNoOwnership)
 ~CStreamReader ()
virtual ERW_Result Read (void *buf, size_t count, size_t *bytes_read=0)
 Read as many as "count" bytes into a buffer pointed to by "buf" argument.
virtual ERW_Result PendingCount (size_t *count)
 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.

Private Member Functions

 CStreamReader (const CStreamReader &)
void operator= (const CStreamReader &)

Private Attributes

AutoPtr< CNcbiIstreamm_Stream


Constructor & Destructor Documentation

CStreamReader::CStreamReader CNcbiIstream is,
EOwnership  own = eNoOwnership
[inline]
 

Definition at line 188 of file rwstream.hpp.

CStreamReader::~CStreamReader  ) 
 

Definition at line 478 of file rwstreambuf.cpp.

CStreamReader::CStreamReader const CStreamReader  )  [private]
 


Member Function Documentation

void CStreamReader::operator= const CStreamReader  )  [private]
 

ERW_Result CStreamReader::PendingCount size_t *  count  )  [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.

Implements IReader.

Definition at line 495 of file rwstreambuf.cpp.

References eRW_Success, and m_Stream.

ERW_Result CStreamReader::Read void *  buf,
size_t  count,
size_t *  bytes_read = 0
[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.

Implements IReader.

Definition at line 483 of file rwstreambuf.cpp.

References eRW_Eof, eRW_Success, and m_Stream.


Member Data Documentation

AutoPtr<CNcbiIstream> CStreamReader::m_Stream [private]
 

Definition at line 198 of file rwstream.hpp.

Referenced by PendingCount(), and Read().


The documentation for this class was generated from the following files:
Generated on Mon Dec 7 14:47:11 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:11 2009 by modify_doxy.py rev. 173732