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:

[legend]
Collaboration diagram for Cut:

[legend]
List of all members.

Public Methods

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

Private Attributes

cmt_string? m_result
int? m_field

Detailed Description

Cut : perform a cut-like operation :.

o collect the '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 55 of file cmt_cvs.cxx.


Constructor & Destructor Documentation

Cut::Cut (? int? ? field )?
?

Definition at line 1946 of file cmt_cvs.cxx.

References m_field.

01947 {
01948   m_field = field;
01949 }

Member Function Documentation

void Cut::begin (? ? )? [virtual]
?

Reimplemented from Awk.

Definition at line 1951 of file cmt_cvs.cxx.

References m_result.

01952 {
01953     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "Cut::begin" << endl;
01954   m_result = "";
01955 }

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

Reimplemented from Awk.

Definition at line 1957 of file cmt_cvs.cxx.

References m_field, m_result, cmt_vector< cmt_string >::size(), and CmtSystem::split().

01958 {
01959     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "Cut::filter" << endl;
01960 
01961   static CmtSystem::cmt_string_vector words;
01962   
01963   CmtSystem::split (line, " \t", words);
01964   
01965   if (words.size () <= m_field) return;
01966   
01967   if (m_result != "") m_result += " ";
01968   m_result += words[m_field];
01969 }

const cmt_string & Cut::result (? ? )?
?

Definition at line 1971 of file cmt_cvs.cxx.

Referenced by CvsImplementation::do_checkout().

01972 {
01973   return (m_result);
01974 }

Member Data Documentation

int Cut::m_field [private]
?

Definition at line 65 of file cmt_cvs.cxx.

Referenced by Cut(), and filter().

cmt_string Cut::m_result [private]
?

Definition at line 64 of file cmt_cvs.cxx.

Referenced by begin(), and filter().


The documentation for this class was generated from the following file:
Generated on Wed Sep 1 11:00:14 2004 for CMT by 1.2.18