Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Grep Class Reference

Grep : perform a grep like operation onto a cmt_string. More...

Inheritance diagram for Grep:

Inheritance graph
[legend]
Collaboration diagram for Grep:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void begin ()
void filter (const cmt_string &line)
const cmt_stringresult () const

Private Attributes

cmt_string m_result

Detailed Description

Grep : perform a grep like operation onto a cmt_string.

o All lines of the input string are collected when they contain the specified pattern. o The input string and the selector pattern are specified in the constructor:

Grep (input_string, pattern)

o All selected lines are accumulated (appended) into the internal variable m_result . 'space' is the separator.

o The accumulator is retrieved by the result () method.

Definition at line 33 of file cmt_cvs.cxx.


Member Function Documentation

void Grep::begin  )  [virtual]
 

Reimplemented from Awk.

Definition at line 2202 of file cmt_cvs.cxx.

References m_result.

02203 {
02204   m_result = "";
02205 }

void Grep::filter const cmt_string line  )  [virtual]
 

Reimplemented from Awk.

Definition at line 2207 of file cmt_cvs.cxx.

References m_result.

02208 {
02209     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "Grep::filter" << endl;
02210 
02211   if (m_result != "") m_result += " ";
02212   m_result += line;
02213 }

const cmt_string & Grep::result  )  const
 

Definition at line 2215 of file cmt_cvs.cxx.

References m_result.

Referenced by CvsImplementation::checkout_from_project_file(), and CvsImplementation::get_cvs_infos_with_offset().

02216 {
02217   return (m_result);
02218 }


Member Data Documentation

cmt_string Grep::m_result [private]
 

Definition at line 42 of file cmt_cvs.cxx.

Referenced by begin(), filter(), and result().


The documentation for this class was generated from the following file:
Generated on Mon May 2 10:25:38 2005 for CMT by doxygen 1.3.5