casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
asdm::CharCompAccumulator Class Reference

Functor class of for a comparison between a "given" character and a characted assumed to be read in a file with a an accumulation of the characters read in the file into a accumulating string. More...

#include <Misc.h>

Public Member Functions

 CharCompAccumulator (std::string *accumulator_p=NULL, std::ifstream *is_p=NULL, off_t limit=0)
 The constructor. More...
 
bool operator() (char cl, char cr)
 Returns true when tpupper(cl) is equal to cr or when the read head position in is_p is >= limit. More...
 

Private Attributes

std::string * accumulator_p
 
std::ifstream * is_p
 
off_t limit
 
int nEqualChars
 
char * asdmDebug_p
 

Detailed Description

Functor class of for a comparison between a "given" character and a characted assumed to be read in a file with a an accumulation of the characters read in the file into a accumulating string.

Instances of this class are meant to be used as binary bool functor comparing the uppercase version of the first (char) operand with the second (char) operand and returning the boolan result of the comparison as long as the read head position in the file passed as a parameter to the constructor is smaller than a limit also passed a parameter to the constructor. Once this limit is passed , the () operator which returns the result of the comparison will return systematically true. When the comparison returns false, the character read from the file is appended to one string whose pointer is passed as a parameter to the constructor.

Definition at line 537 of file Misc.h.

Constructor & Destructor Documentation

asdm::CharCompAccumulator::CharCompAccumulator ( std::string *  accumulator_p = NULL,
std::ifstream *  is_p = NULL,
off_t  limit = 0 
)

The constructor.

Parameters
accumulator_pa pointer to a string where the characters will be accumulated as a side effect of the call to the operator ().
is_pa pointer to the file where the characters are assumed to be read.
limitthe position in the file beyond which the comparison will return systematically true.

Member Function Documentation

bool asdm::CharCompAccumulator::operator() ( char  cl,
char  cr 
)

Returns true when tpupper(cl) is equal to cr or when the read head position in is_p is >= limit.

Returns
a boolean

Side effect : append cl to *accumulator when the result of the comparison is false.

Member Data Documentation

std::string* asdm::CharCompAccumulator::accumulator_p
private

Definition at line 539 of file Misc.h.

char* asdm::CharCompAccumulator::asdmDebug_p
private

Definition at line 543 of file Misc.h.

std::ifstream* asdm::CharCompAccumulator::is_p
private

Definition at line 540 of file Misc.h.

off_t asdm::CharCompAccumulator::limit
private

Definition at line 541 of file Misc.h.

int asdm::CharCompAccumulator::nEqualChars
private

Definition at line 542 of file Misc.h.


The documentation for this class was generated from the following file: