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

Inheritance graph
[legend]
Collaboration diagram for RecursivePass1:

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


Member Function Documentation

void RecursivePass1::begin  )  [virtual]
 

Reimplemented from Awk.

Definition at line 2290 of file cmt_cvs.cxx.

References m_first, and m_result.

02291 {
02292   m_first = true;
02293   m_result = "";
02294 }

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

Reimplemented from Awk.

Definition at line 2296 of file cmt_cvs.cxx.

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

02297 {
02298     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "RecursivePass1::filter> " 
02299     //                                          << "line=[" << line << "]" << endl;
02300 
02301   if (line.find ("use CMT") != cmt_string::npos) return;
02302   if (line.find ("use cmt") != cmt_string::npos) return;
02303   
02304   History& h = History::instance ();
02305   
02306   if (h.is_installed (line)) return;
02307   
02308   CmtSystem::cmt_string_vector words;
02309   
02310   CmtSystem::split (line, " \t", words);
02311 
02312   enum
02313   {
02314     need_package,
02315     need_version,
02316     need_path,
02317     no_need
02318   } state = need_package;
02319 
02320   cmt_string package;
02321   cmt_string version;
02322   cmt_string path;
02323 
02324   for (int i = 1; i < words.size (); i++)
02325     {
02326       const cmt_string& s = words[i];
02327 
02328       if (s[0] == '-') continue;
02329 
02330       switch (state)
02331         {
02332           case need_package:
02333             package = s;
02334             state = need_version;
02335             break;
02336           case need_version:
02337             version = s;
02338             state = need_path;
02339             break;
02340           case need_path:
02341             path = s;
02342             state = no_need;
02343             break;
02344         }
02345     }
02346   
02347   if (version.find ("*") != cmt_string::npos)
02348     {
02349         /*
02350       cout << "# ================= Package " << package 
02351            << " version " << version << " " << path 
02352            << " has wild cards and will not be considered." << endl;
02353         */
02354       return;
02355     }
02356 
02362   m_result += line;
02363   m_result += "\n";
02364   
02365   if (m_first)
02366     {
02367       m_first = false;
02368       cout << "  # --> now propagate cmt checkout to :" << endl;
02369     }
02370   
02371   cout << "  #     " << package << " " << version << " " << path << endl;
02372 }

const cmt_string & RecursivePass1::result  )  const
 

Definition at line 2374 of file cmt_cvs.cxx.

References m_result.

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

02375 {
02376   return (m_result);
02377 }


Member Data Documentation

bool RecursivePass1::m_first [private]
 

Definition at line 106 of file cmt_cvs.cxx.

Referenced by begin(), and filter().

cmt_string RecursivePass1::m_result [private]
 

Definition at line 105 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:59 2005 for CMT by doxygen 1.3.5