Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Cut Class Reference

Cut : perform a cut-like operation :. More...

Inheritance diagram for Cut

Inheritance graph
[legend]
Collaboration diagram for Cut:

Collaboration graph
[legend]
List of all members.

Public Methods

 Cut (int field)
void begin ()
void filter (const cmt_string& line)
const cmt_stringresult () const

Private Attributes

cmt_string m_result
int m_field

Detailed Description

Cut : perform a cut-like operation :.

o collect the <field>'th field of every line into the m_result internal variable

o the field number is given in the constructor and starts at zero.

o selected fields are accumulated with a space as separator.

Definition at line 48 of file cmt_cvs.cxx.


Constructor & Destructor Documentation

Cut::Cut ( int field )
 

Definition at line 1566 of file cmt_cvs.cxx.

01567 {
01568   m_field = field;
01569 }


Member Function Documentation

void Cut::begin ( ) [virtual]
 

Reimplemented from Awk.

Definition at line 1571 of file cmt_cvs.cxx.

01572 {
01573     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "Cut::begin" << endl;
01574   m_result = "";
01575 }

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

Reimplemented from Awk.

Definition at line 1577 of file cmt_cvs.cxx.

01578 {
01579     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "Cut::filter" << endl;
01580 
01581   static CmtSystem::cmt_string_vector words;
01582   
01583   CmtSystem::split (line, " \t", words);
01584   
01585   if (words.size () <= m_field) return;
01586   
01587   if (m_result != "") m_result += " ";
01588   m_result += words[m_field];
01589 }

const cmt_string & Cut::result ( ) const
 

Definition at line 1591 of file cmt_cvs.cxx.

Referenced by CvsImplementation::do_checkout().

01592 {
01593   return (m_result);
01594 }


Member Data Documentation

int Cut::m_field [private]
 

Definition at line 58 of file cmt_cvs.cxx.

cmt_string Cut::m_result [private]
 

Definition at line 57 of file cmt_cvs.cxx.


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