Main Page   Class Hierarchy   Compound List   File List   Compound 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 Methods

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 24 of file cmt_cvs.cxx.


Member Function Documentation

void Grep::begin ( ) [virtual]
 

Reimplemented from Awk.

Definition at line 1546 of file cmt_cvs.cxx.

01547 {
01548   m_result = "";
01549 }

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

Reimplemented from Awk.

Definition at line 1551 of file cmt_cvs.cxx.

01552 {
01553     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "Grep::filter" << endl;
01554 
01555   if (m_result != "") m_result += " ";
01556   m_result += line;
01557 }

const cmt_string & Grep::result ( ) const
 

Definition at line 1559 of file cmt_cvs.cxx.

Referenced by CvsImplementation::show_cvs_infos().

01560 {
01561   return (m_result);
01562 }


Member Data Documentation

cmt_string Grep::m_result [private]
 

Definition at line 33 of file cmt_cvs.cxx.


The documentation for this class was generated from the following file:
Generated at Thu May 16 16:27:50 2002 for CMT by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000