casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
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>

List of all members.

Public Member Functions

 CharCompAccumulator (std::string *accumulator_p=NULL, std::ifstream *is_p=NULL, off_t limit=0)
 The constructor.
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.
 CharCompAccumulator (std::string *accumulator_p=NULL, std::ifstream *is_p=NULL, off_t limit=0)
 The constructor.
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.

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 454 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.
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.

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

Definition at line 456 of file Misc.h.

Definition at line 460 of file Misc.h.

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

Definition at line 457 of file Misc.h.

Definition at line 458 of file Misc.h.

Definition at line 459 of file Misc.h.


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