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

RecursivePass1 Class Reference

RecursivePass1 : simply validate use statements in a requirements file and echo those that really need to be handled. More...

Inheritance diagram for RecursivePass1:

[legend]
Collaboration diagram for RecursivePass1:

[legend]
List of all members.

Public Methods

void? begin ()
void? filter (const cmt_string &line)
const cmt_string &? result () const
? At the first pass, we simply accumulate the not-yet handled use statements.


Private Attributes

cmt_string? m_result
bool? m_first

Detailed Description

RecursivePass1 : simply validate use statements in a requirements file and echo those that really need to be handled.

Definition at line 88 of file cmt_cvs.cxx.


Member Function Documentation

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

Reimplemented from Awk.

Definition at line 2008 of file cmt_cvs.cxx.

References m_first, and m_result.

02009 {
02010   m_first = true;
02011   m_result = "";
02012 }

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

Reimplemented from Awk.

Definition at line 2014 of file cmt_cvs.cxx.

References cmt_string::find(), History::instance(), History::is_installed(), m_first, m_result, cmt_string::npos, cmt_vector< cmt_string >::size(), and CmtSystem::split().

02015 {
02016     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "RecursivePass1::filter> " 
02017     //                                          << "line=[" << line << "]" << endl;
02018 
02019   if (line.find ("use CMT") != cmt_string::npos) return;
02020   if (line.find ("use cmt") != cmt_string::npos) return;
02021   
02022   History& h = History::instance ();
02023   
02024   if (h.is_installed (line)) return;
02025   
02026   CmtSystem::cmt_string_vector words;
02027   
02028   CmtSystem::split (line, " \t", words);
02029 
02030   enum
02031   {
02032     need_package,
02033     need_version,
02034     need_path,
02035     no_need
02036   } state = need_package;
02037 
02038   cmt_string package;
02039   cmt_string version;
02040   cmt_string path;
02041 
02042   for (int i = 1; i < words.size (); i++)
02043     {
02044       const cmt_string& s = words[i];
02045 
02046       if (s[0] == '-') continue;
02047 
02048       switch (state)
02049         {
02050           case need_package:
02051             package = s;
02052             state = need_version;
02053             break;
02054           case need_version:
02055             version = s;
02056             state = need_path;
02057             break;
02058           case need_path:
02059             path = s;
02060             state = no_need;
02061             break;
02062         }
02063     }
02064   
02065   if (version.find ("*") != cmt_string::npos)
02066     {
02067         /*
02068       cout << "# ================= Package " << package 
02069            << " version " << version << " " << path 
02070            << " has wild cards and will not be considered." << endl;
02071         */
02072       return;
02073     }
02074 
02080   m_result += line;
02081   m_result += "\n";
02082   
02083   if (m_first)
02084     {
02085       m_first = false;
02086       cout << "  # --> now propagate cmt checkout to :" << endl;
02087     }
02088   
02089   cout << "  #     " << package << " " << version << " " << path << endl;
02090 }

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

At the first pass, we simply accumulate the not-yet handled use statements.

Definition at line 2092 of file cmt_cvs.cxx.

Referenced by CvsImplementation::checkout_from_requirements().

02093 {
02094   return (m_result);
02095 }

Member Data Documentation

bool RecursivePass1::m_first [private]
?

Definition at line 98 of file cmt_cvs.cxx.

Referenced by begin(), and filter().

cmt_string RecursivePass1::m_result [private]
?

Definition at line 97 of file cmt_cvs.cxx.

Referenced by begin(), and filter().


The documentation for this class was generated from the following file:
Generated on Thu Jul 1 15:27:35 2004 for CMT by 1.2.18