Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

LineStream Class Reference

This is a special ostream that writes to a memory buffer, like ostrstream. More...

#include <lineStream.h>

List of all members.

Public Member Functions

 LineStream ()
bool is_text_available () const
 Returns true if there is at least one line of text (or even a partial line) available in the LineStream object.

string get_line ()
 Extracts and returns the next line (or partial line) of text available in the LineStream object.

bool has_newline () const
 Returns true if the line of text most recently returned by get_line() was written out with a terminating newline, or false if a newline character has not yet been written to the LineStream.


Private Attributes

LineStreamBuf _lsb


Detailed Description

This is a special ostream that writes to a memory buffer, like ostrstream.

However, its contents can be continuously extracted as a sequence of lines of text.

Unlike ostrstream, which can only be extracted from once (and then the buffer freezes and it can no longer be written to), the LineStream is not otherwise affected when a line of text is extracted. More text can still be written to it and continuously extracted.

Definition at line 56 of file lineStream.h.


Constructor & Destructor Documentation

LineStream::LineStream  )  [inline]
 

Definition at line 30 of file lineStream.I.

References _lsb, INLINE, and LineStreamBuf::is_text_available().


Member Function Documentation

string LineStream::get_line  )  [inline]
 

Extracts and returns the next line (or partial line) of text available in the LineStream object.

Once the line has been extracted, you may call has_newline() to determine whether or not there was an explicit newline character written following this line.

Definition at line 69 of file lineStream.I.

Referenced by main().

bool LineStream::has_newline  )  const [inline]
 

Returns true if the line of text most recently returned by get_line() was written out with a terminating newline, or false if a newline character has not yet been written to the LineStream.

Definition at line 88 of file lineStream.I.

Referenced by main().

bool LineStream::is_text_available  )  const [inline]
 

Returns true if there is at least one line of text (or even a partial line) available in the LineStream object.

If this returns true, the line may then be retrieved via get_line().

Definition at line 48 of file lineStream.I.

References _lsb, LineStreamBuf::get_line(), and INLINE.

Referenced by main().


Member Data Documentation

LineStreamBuf LineStream::_lsb [private]
 

Definition at line 65 of file lineStream.h.

Referenced by is_text_available(), and LineStream().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:52:00 2003 for Panda by doxygen1.3