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

PackageSelector Class Reference

This PathScanner actor accumulates all found packages into a cmt_string_vector It is used by the broadcast operation. More...

Inheritance diagram for PackageSelector:

Inheritance graph
[legend]
Collaboration diagram for PackageSelector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PackageSelector (CmtSystem::cmt_string_vector &uses)
void run (const cmt_string &package, const cmt_string &version, const cmt_string &path)

Private Attributes

CmtSystem::cmt_string_vectorm_uses

Detailed Description

This PathScanner actor accumulates all found packages into a cmt_string_vector It is used by the broadcast operation.

Definition at line 120 of file cmt_parser.cxx.


Constructor & Destructor Documentation

PackageSelector::PackageSelector CmtSystem::cmt_string_vector uses  ) 
 

Definition at line 181 of file cmt_parser.cxx.

References CmtSystem::cmt_string_vector.

00181                                                                   : m_uses(uses)
00182 {
00183 }


Member Function Documentation

void PackageSelector::run const cmt_string package,
const cmt_string version,
const cmt_string path
[virtual]
 

Reimplemented from PathScanner::actor.

Definition at line 186 of file cmt_parser.cxx.

References cmt_vector< T >::add(), cmt_string::c_str(), CmtSystem::file_separator(), m_uses, cmt_string::replace(), and CmtSystem::test_file().

00189 {
00190   //
00191   // this might be called on a package with no version directory.
00192   // then simply the version argument is empty.
00193   // 
00194 
00195   cmt_string r = CmtSystem::file_separator ();
00196   r += "requirements";
00197 
00198   cmt_string temp;
00199 
00200   if (version == "")
00201     {
00202       temp = path;
00203       //temp += CmtSystem::file_separator ();
00204       //temp += package;
00205       temp += CmtSystem::file_separator ();
00206       temp += "cmt";
00207       temp += r;
00208       
00209       if (!CmtSystem::test_file (temp)) return;
00210     }
00211   else
00212     {
00213       temp = path;
00214       //temp += CmtSystem::file_separator ();
00215       //temp += package;
00216       temp += CmtSystem::file_separator ();
00217       temp += version;
00218       temp += CmtSystem::file_separator ();
00219       temp += "cmt";
00220       temp += r;
00221       
00222       if (!CmtSystem::test_file (temp))
00223         {
00224           temp = path;
00225           //temp += CmtSystem::file_separator ();
00226           //temp += package;
00227           temp += CmtSystem::file_separator ();
00228           temp += version;
00229           temp += CmtSystem::file_separator ();
00230           temp += "mgr";
00231           temp += r;
00232           
00233           if (!CmtSystem::test_file (temp))
00234             {
00235               return;
00236             }
00237         }
00238     }
00239 
00240   temp.replace (r.c_str(), "");
00241   cmt_string& use = m_uses.add ();
00242   use = temp;
00243 }


Member Data Documentation

CmtSystem::cmt_string_vector& PackageSelector::m_uses [private]
 

Definition at line 128 of file cmt_parser.cxx.

Referenced by run().


The documentation for this class was generated from the following file:
Generated on Mon May 2 10:25:54 2005 for CMT by doxygen 1.3.5