Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

RecursivePass3 Class Reference

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

Inheritance diagram for RecursivePass3:

Inheritance graph
[legend]
Collaboration diagram for RecursivePass3:

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

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

Definition at line 133 of file cmt_cvs.cxx.


Member Function Documentation

void RecursivePass3::begin  )  [virtual]
 

Reimplemented from Awk.

Definition at line 2462 of file cmt_cvs.cxx.

References m_first, and m_result.

02463 {
02464   m_first = true;
02465   m_result = "";
02466 }

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

Reimplemented from Awk.

Definition at line 2468 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().

02469 {
02470   History& h = History::instance ();
02471   
02472   if (h.is_installed (line)) return;
02473   
02474   CmtSystem::cmt_string_vector words;
02475   
02476   CmtSystem::split (line, " \t", words);
02477 
02478   enum
02479   {
02480     need_project,
02481     need_version,
02482     need_tag,
02483     no_need
02484   } state = need_project;
02485 
02486   cmt_string project;
02487   cmt_string version;
02488   cmt_string tag;
02489 
02490   for (int i = 1; i < words.size (); i++)
02491     {
02492       const cmt_string& s = words[i];
02493 
02494       switch (state)
02495         {
02496           case need_project:
02497             project = s;
02498             state = need_version;
02499             break;
02500           case need_version:
02501             version = s;
02502             state = need_tag;
02503             break;
02504           case need_tag:
02505             tag = s;
02506             state = no_need;
02507             break;
02508         }
02509     }
02510   
02511   if (version.find ("*") != cmt_string::npos)
02512     {
02513         /*
02514       cout << "# ================= Project " << project 
02515            << " version " << version << " " << path 
02516            << " has wild cards and will not be considered." << endl;
02517         */
02518       return;
02519     }
02520 
02526   m_result += line;
02527   m_result += "\n";
02528   
02529   if (m_first)
02530     {
02531       m_first = false;
02532       cout << "  # --> now propagate cmt checkout to :" << endl;
02533     }
02534   
02535   cout << "  #     " << project << " " << version << " " << tag << endl;
02536 }

const cmt_string & RecursivePass3::result  )  const
 

Definition at line 2538 of file cmt_cvs.cxx.

References m_result.

Referenced by CvsImplementation::checkout_from_project_file().

02539 {
02540   return (m_result);
02541 }


Member Data Documentation

bool RecursivePass3::m_first [private]
 

Definition at line 143 of file cmt_cvs.cxx.

Referenced by begin(), and filter().

cmt_string RecursivePass3::m_result [private]
 

Definition at line 142 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