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

LineStreamBuf Class Reference

Used by LineStream to implement an ostream that writes to a memory buffer, whose contents can be continuously extracted as a sequence of lines of text. More...

#include <lineStreamBuf.h>

List of all members.

Public Member Functions

 LineStreamBuf ()
virtual ~LineStreamBuf ()
bool is_text_available () const
string get_line ()
 Extracts the next line of text from the LineStreamBuf, and sets the has_newline() flag according to whether this line had a trailing newline or not.

bool has_newline () const

Protected Member Functions

virtual int overflow (int c)
 Called by the system ostream implementation when its internal buffer is filled, plus one character.

virtual int sync ()
 Called by the system ostream implementation when the buffer should be flushed to output (for instance, on destruction).


Private Member Functions

void write_chars (const char *start, int length)
 An internal function called by sync() and overflow() to store one or more characters written to the stream into the memory buffer.


Private Attributes

string _data
bool _has_newline


Detailed Description

Used by LineStream to implement an ostream that writes to a memory buffer, whose contents can be continuously extracted as a sequence of lines of text.

Definition at line 42 of file lineStreamBuf.h.


Constructor & Destructor Documentation

LineStreamBuf::LineStreamBuf  ) 
 

Definition at line 37 of file lineStreamBuf.cxx.

LineStreamBuf::~LineStreamBuf  )  [virtual]
 

Definition at line 56 of file lineStreamBuf.cxx.

References _data, _has_newline, and size_t.


Member Function Documentation

string LineStreamBuf::get_line  ) 
 

Extracts the next line of text from the LineStreamBuf, and sets the has_newline() flag according to whether this line had a trailing newline or not.

Definition at line 75 of file lineStreamBuf.cxx.

References _data.

Referenced by LineStream::is_text_available().

bool LineStreamBuf::has_newline  )  const [inline]
 

Definition at line 43 of file lineStreamBuf.I.

References _data, INLINE, and length.

bool LineStreamBuf::is_text_available  )  const [inline]
 

Definition at line 31 of file lineStreamBuf.I.

References _has_newline, and INLINE.

Referenced by LineStream::LineStream().

int LineStreamBuf::overflow int  c  )  [protected, virtual]
 

Called by the system ostream implementation when its internal buffer is filled, plus one character.

Definition at line 124 of file lineStreamBuf.cxx.

int LineStreamBuf::sync void   )  [protected, virtual]
 

Called by the system ostream implementation when the buffer should be flushed to output (for instance, on destruction).

Definition at line 106 of file lineStreamBuf.cxx.

void LineStreamBuf::write_chars const char *  start,
int  length
[inline, private]
 

An internal function called by sync() and overflow() to store one or more characters written to the stream into the memory buffer.

Definition at line 60 of file lineStreamBuf.I.


Member Data Documentation

string LineStreamBuf::_data [private]
 

Definition at line 58 of file lineStreamBuf.h.

Referenced by get_line(), has_newline(), and ~LineStreamBuf().

bool LineStreamBuf::_has_newline [private]
 

Definition at line 59 of file lineStreamBuf.h.

Referenced by is_text_available(), and ~LineStreamBuf().


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