Accum< Container > Struct Template Reference

An Accum object is a template class object whose role is to provide a generic interface for any standard sequence container to the accumulate_lines virtual interface. More...

#include <file.h>

Inheritance diagram for Accum< Container >:
Inheritance graph
[legend]
Collaboration diagram for Accum< Container >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Accum (Container &container)
std::string & back ()
 back() is called to get a reference to the last string in the container -- presumbaly one created using the above push_back method.
void push_back (std::string const &s)
 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().

Public Attributes

Container & container_

Detailed Description

template<class Container>
struct cxxtls::FileName::Accum< Container >

An Accum object is a template class object whose role is to provide a generic interface for any standard sequence container to the accumulate_lines virtual interface.

By rights, this should be a nested class found within the read_file template function below, but you can't instantiate a template given a function local class. Sooner or later these silly restrictions will go away, but now they haven't.

Definition at line 964 of file file.h.


Constructor & Destructor Documentation

Accum ( Container &  container  ) 

Definition at line 979 of file file.h.


Member Function Documentation

std::string& back (  )  [virtual]

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

Implements accumulate_lines.

Definition at line 985 of file file.h.

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

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

Implements accumulate_lines.

Definition at line 984 of file file.h.

virtual void setBackHasCR ( bool  flag  )  [virtual, inherited]

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:


Member Data Documentation

Container& container_

Definition at line 977 of file file.h.


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