Dv::Util::charraystream Class Reference

A charraystream provides an input stream on an existing array of characters (which is not copied). More...

#include <charraystream.h>

Collaboration diagram for Dv::Util::charraystream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 charraystream (const char *begin, size_t size)
 Constructor.
std::streambuf * rdbuf () const
 We refuse to divulge the streambuf.

Private Attributes

charraystreambuf buf

Detailed Description

A charraystream provides an input stream on an existing array of characters (which is not copied).

See also:
Dv::Util::charraystreambuf

Example usage:

 const char* p = "abc def 123";
 Dv::Util::charraystream is(p, strlen(p));
 std::string s;
 while (is >> s)
   ;

Definition at line 38 of file charraystream.h.


Constructor & Destructor Documentation

Dv::Util::charraystream::charraystream ( const char *  begin,
size_t  size 
) [inline]

Constructor.

Parameters:
begin pointer to the first character in the array
size of the array

Definition at line 44 of file charraystream.h.

References buf, and rdbuf().


Member Function Documentation

std::streambuf* Dv::Util::charraystream::rdbuf (  )  const [inline]

We refuse to divulge the streambuf.

Note that this definition will also block rdbuf(streambuf*).

Definition at line 50 of file charraystream.h.

References buf.

Referenced by charraystream().


Member Data Documentation

Definition at line 52 of file charraystream.h.

Referenced by charraystream(), and rdbuf().


The documentation for this class was generated from the following file:

dvutil-1.0.10 [ 5 December, 2009]