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

Search Toolkit Book for CStringReader

#include <stream_utils.hpp>

Inheritance diagram for CStringReader:

Inheritance graph
[legend]
Collaboration diagram for CStringReader:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 131 of file stream_utils.hpp.

Public Member Functions

 CStringReader (const string &s)
ERW_Result Read (void *buf, size_t count, size_t *bytes_read)
 Read as many as "count" bytes into a buffer pointed to by "buf" argument.
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 Attributes

string m_String
SIZE_TYPE m_Position


Constructor & Destructor Documentation

CStringReader::CStringReader const string &  s  )  [inline, explicit]
 

Definition at line 134 of file stream_utils.hpp.


Member Function Documentation

ERW_Result CStringReader::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 583 of file stream_utils.cpp.

References _ASSERT, eRW_Eof, eRW_Success, m_Position, and m_String.

ERW_Result CStringReader::Read void *  buf,
size_t  count,
size_t *  bytes_read
[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 562 of file stream_utils.cpp.

References _ASSERT, m_Position, and m_String.


Member Data Documentation

SIZE_TYPE CStringReader::m_Position [private]
 

Definition at line 143 of file stream_utils.hpp.

Referenced by PendingCount(), and Read().

string CStringReader::m_String [private]
 

Definition at line 142 of file stream_utils.hpp.

Referenced by PendingCount(), and Read().


The documentation for this class was generated from the following files:
Generated on Wed Dec 9 08:11:00 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Wed Dec 09 08:20:03 2009 by modify_doxy.py rev. 173732