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>
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. |
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.
virtual ~accumulate_lines | ( | ) | [virtual] |
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 >.
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 >.
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.