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

RecursivePass2 Class Reference

Inheritance diagram for RecursivePass2:

Inheritance graph
[legend]
Collaboration diagram for RecursivePass2:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RecursivePass2 (CvsImplementation &cvs)
void begin ()
void filter (const cmt_string &line)

Private Attributes

CvsImplementationm_cvs

Constructor & Destructor Documentation

RecursivePass2::RecursivePass2 CvsImplementation cvs  ) 
 

Definition at line 2381 of file cmt_cvs.cxx.

02381                                                       : m_cvs (cvs)
02382 {
02383 }


Member Function Documentation

void RecursivePass2::begin  )  [virtual]
 

Reimplemented from Awk.

Definition at line 2385 of file cmt_cvs.cxx.

02386 {
02387 }

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

Reimplemented from Awk.

Definition at line 2389 of file cmt_cvs.cxx.

References CmtSystem::cmt_string_vector, CvsImplementation::do_checkout_phase2(), cmt_string::find(), History::install(), History::instance(), History::is_installed(), m_cvs, cmt_vector< T >::size(), and CmtSystem::split().

02390 {
02391     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "RecursivePass2::filter> " 
02392     //                                          << "line=[" << line << "]" << endl;
02393 
02400   History& h = History::instance ();
02401   
02402   if (h.is_installed (line)) return;
02403   
02404   h.install (line);
02405   
02406   CmtSystem::cmt_string_vector words;
02407   
02408   CmtSystem::split (line, " \t", words);
02409 
02410   enum
02411   {
02412     need_package,
02413     need_version,
02414     need_path,
02415     no_need
02416   } state = need_package;
02417 
02418   cmt_string package;
02419   cmt_string version;
02420   cmt_string path;
02421 
02422   for (int i = 1; i < words.size (); i++)
02423     {
02424       const cmt_string& s = words[i];
02425 
02426       if (s[0] == '-') continue;
02427 
02428       switch (state)
02429         {
02430           case need_package:
02431             package = s;
02432             state = need_version;
02433             break;
02434           case need_version:
02435             version = s;
02436             state = need_path;
02437             break;
02438           case need_path:
02439             path = s;
02440             state = no_need;
02441             break;
02442         }
02443     }
02444 
02445   if (version.find ("*") != cmt_string::npos)
02446     {
02447         /*
02448       cout << "# ================= Package " << package 
02449            << " version " << version << " " << path 
02450            << " has wild cards and will not be considered." << endl;
02451         */
02452     }
02453   else
02454     {
02455       static const cmt_string empty;
02456       m_cvs.do_checkout_phase2 (path, package, version, empty);
02457     }
02458 }


Member Data Documentation

CvsImplementation& RecursivePass2::m_cvs [private]
 

Definition at line 124 of file cmt_cvs.cxx.

Referenced by filter().


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