Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

util::io::ListStream< E, Tr > Class Template Reference

#include <ListStream.h>

Inheritance diagram for util::io::ListStream< E, Tr >:

util::Object List of all members.

Detailed Description

template<class E = char, class Tr = std::char_traits<char>>
class util::io::ListStream< E, Tr >

A stream that writes and retrieves data to and from a List object.

ListStream works both as an input buffer and as an output buffer. An example:

 using namespace std;
 using namespace util;

 ListStream<> stream;
 stream << "Here we have " << 3 << " different objects inserted.";
 string str;
 for(;;)
   {
     string >> str;
     if (!stream) break;
     cout << str << endl;
   }
 

The example should output:

 Here
 we
 have
 3
 different
 objects
 inserted.
 


Public Methods

 ListStream (List< E > &buffer)
 Create a new ListStream with the given List as an I/O buffer.

 ListStream (int blockSize=1024)
 Create a new ListStream with the given block size.

virtual ~ListStream ()
 Destroy the ListStream object.

List< E > & getList ()
 Get a reference to the list the input buffer uses as a data storage.

const List< E > & getList () const
 Get a const reference to the list the input buffer uses as a data storage.


Constructor & Destructor Documentation

template<class E = char, class Tr = std::char_traits<char>>
util::io::ListStream< E, Tr >::ListStream List< E > &    buffer [inline]
 

Create a new ListStream with the given List as an I/O buffer.

Parameters:
buffer  the List the stream should write its data to or from which it should read data

template<class E = char, class Tr = std::char_traits<char>>
util::io::ListStream< E, Tr >::ListStream int    blockSize = 1024 [inline]
 

Create a new ListStream with the given block size.

Parameters:
blocSize  the amount of bytes (or double-bytes) the I/O buffer grows whenever its size is exceeded


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.