accumulate_lines Struct Reference

A class of functor objects whose purpose is to provide a generic interface between the read_* functions, below, and some container used to hold lines read. More...

#include <file.h>

Inheritance diagram for accumulate_lines:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual std::string & back ()=0
 back() is called to get a reference to the last string in the container -- presumbaly one created using the above push_back method.
virtual void push_back (std::string const &new_line)=0
 push_back is called to append a new std::string to the end of the container
virtual void setBackHasCR (bool flag)
 read_lines() calls this function to indicate to the line accumulator that the most recently read line, if any had a CR character removed from it. This function will only be called if there is a trailing CR and if the removeCR flag is passed to read_lines().
virtual ~accumulate_lines ()
 Destructor must be virtual because other methods are virtual.

Detailed Description

A class of functor objects whose purpose is to provide a generic interface between the read_* functions, below, and some container used to hold lines read.

An accumulate_lines object has two virtual functions, push_back(), and back(). These let the read_lines function append new lines to the container and access the last line thereof when it needs to update it.

See the read() template below for an example use.

Definition at line 883 of file file.h.


Constructor & Destructor Documentation

virtual ~accumulate_lines (  )  [virtual]

Destructor must be virtual because other methods are virtual.

Definition at line 896 of file file.h.


Member Function Documentation

virtual std::string& back (  )  [pure virtual]

back() is called to get a reference to the last string in the container -- presumbaly one created using the above push_back method.

Implemented in Accumulate_File_Lines, and Accum< Container >.

Here is the caller graph for this function:

virtual void push_back ( std::string const &  new_line  )  [pure virtual]

push_back is called to append a new std::string to the end of the container

Implemented in Accumulate_File_Lines, and Accum< Container >.

Here is the caller graph for this function:

virtual void setBackHasCR ( bool  flag  )  [virtual]

read_lines() calls this function to indicate to the line accumulator that the most recently read line, if any had a CR character removed from it. This function will only be called if there is a trailing CR and if the removeCR flag is passed to read_lines().

Reimplemented in Accumulate_File_Lines.

Definition at line 912 of file file.h.

Here is the caller graph for this function:


The documentation for this struct was generated from the following file:
Generated on Wed Feb 29 22:55:28 2012 for CXXUtilities by  doxygen 1.6.3