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

Project Class Reference

#include

Collaboration diagram for Project:

[legend]
List of all members.

Public Types

typedef cmt_vector< Project >? ProjectVector

Public Methods

? Project ()
const cmt_string &? get_name () const
const cmt_string &? get_cmtpath () const
const cmt_string &? get_cmtpath_pwd () const
const cmt_string &? get_cmtpath_source () const
void? set_name (const cmt_string &new_name)
void? set_cmtpath (const cmt_string &path)
void? set_cmtpath_pwd (const cmt_string &path)
void? set_cmtpath_source (const cmt_string &source)
void? set_predecessor (Project *predecessor)
void? set_reference (Project *reference)
void? clear ()
void? configure ()
Project &? operator= (const Project &other)
bool? operator== (const cmt_string &name) const
bool? operator!= (const cmt_string &name) const
void? show () const
void? show_strategies () const
int? get_build_strategy () const
int? get_setup_strategy () const
void? set_build_strategy (int mask, int strategy)
void? set_setup_strategy (int mask, int strategy)

Static Public Methods

void? create (const cmt_string &name)
Project *? find_by_name (const cmt_string &name)
Project *? find_by_cmtpath (const cmt_string &cmtpath)
Project *? get_current ()
Project *? add (const cmt_string &name)
ProjectVector &? projects ()
void? clear_all ()
void? show_all ()
void? show_paths ()
const cmt_string &? get_project_file_name ()
void? fill_selection (int depth, CmtSystem::cmt_string_vector &path_selections)
void? broadcast (IProjectAction &action)
void? reverse_broadcast (IProjectAction &action)
void? scan_paths (PathScanner &scanner, PathScanner::actor &actor)
void? scan_paths_for_package (PathScanner &scanner, const cmt_string &name)
cmt_string? find_in_cmt_paths (const cmt_string &path)

Private Attributes

cmt_string? m_name
Project *? m_reference
Project *? m_predecessor
cmt_string? m_cmtpath
cmt_string? m_cmtpath_pwd
cmt_string? m_cmtpath_source
int? m_build_strategy_mask
int? m_build_strategy
int? m_setup_strategy_mask
int? m_setup_strategy
bool? m_configured
Tag *? m_prototypes_tag
Tag *? m_no_prototypes_tag
Tag *? m_rebuild_makefiles_tag
Tag *? m_keep_makefiles_tag
Tag *? m_with_installarea_tag
Tag *? m_without_installarea_tag
Tag *? m_setup_config_tag
Tag *? m_setup_no_config_tag
Tag *? m_setup_root_tag
Tag *? m_setup_no_root_tag
Tag *? m_setup_cleanup_tag
Tag *? m_setup_no_cleanup_tag

Member Typedef Documentation

typedef cmt_vector Project::ProjectVector
?

Definition at line 42 of file cmt_project.h.


Constructor & Destructor Documentation

Project::Project (? ? )?
?

Definition at line 552 of file cmt_project.cxx.

References clear().

00552                   : m_name (""), m_reference (0), m_predecessor (0)
00553 {
00554   clear ();
00555 }

Member Function Documentation

Project * Project::add (? const cmt_string &? ? name )? [static]
?

Definition at line 318 of file cmt_project.cxx.

References cmt_vector< Project >::add(), find_by_name(), projects(), set_name(), and set_reference().

Referenced by ProjectFactory::create_project().

00319 {
00320   static ProjectVector& Projects = projects ();
00321 
00322   //cout << "Project::add> name=" << name << endl;
00323 
00324   {
00325     Project* project;
00326 
00327     project = find_by_name (name);
00328     if (project != 0) 
00329       {
00330         Project& p = Projects.add ();
00331 
00332         project->set_reference (&p);
00333         p.set_name (name);
00334 
00335         return (&p);
00336       }
00337   }
00338 
00339   Project& project = Projects.add ();
00340   project.set_name (name);
00341 
00342   return (&project);
00343 }

void Project::broadcast (? IProjectAction &? ? action )? [static]
?

Definition at line 453 of file cmt_project.cxx.

References projects(), IProjectAction::run(), and cmt_vector< Project >::size().

Referenced by Use::move_to().

00454 {
00455   static ProjectVector& Projects = projects ();
00456 
00457   for (int i = 0; i < Projects.size (); i++)
00458     {
00459       const Project& project = Projects[i];
00460 
00461       if (!action.run (project)) break;
00462     }
00463 }

void Project::clear (? ? )?
?

Definition at line 619 of file cmt_project.cxx.

References DefaultBuildStrategy, DefaultSetupStrategy, m_build_strategy, m_build_strategy_mask, m_cmtpath, m_cmtpath_pwd, m_cmtpath_source, m_configured, m_keep_makefiles_tag, m_name, m_no_prototypes_tag, m_prototypes_tag, m_rebuild_makefiles_tag, m_setup_cleanup_tag, m_setup_config_tag, m_setup_no_cleanup_tag, m_setup_no_config_tag, m_setup_no_root_tag, m_setup_root_tag, m_setup_strategy, m_setup_strategy_mask, m_with_installarea_tag, and m_without_installarea_tag.

Referenced by clear_all(), and Project().

00620 {
00621   m_name = "";
00622   m_cmtpath = "";
00623   m_cmtpath_pwd = "";
00624   m_cmtpath_source = "";
00625 
00626   m_build_strategy_mask = 0;
00627   m_build_strategy = DefaultBuildStrategy;
00628   m_setup_strategy_mask = 0;
00629   m_setup_strategy = DefaultSetupStrategy;
00630 
00631   m_configured = false;
00632 
00633   m_prototypes_tag = 0;
00634   m_no_prototypes_tag = 0;
00635   m_rebuild_makefiles_tag = 0;
00636   m_keep_makefiles_tag = 0;
00637   m_with_installarea_tag = 0;
00638   m_without_installarea_tag = 0;
00639   
00640   m_setup_config_tag = 0;
00641   m_setup_no_config_tag = 0;
00642   m_setup_root_tag = 0;
00643   m_setup_no_root_tag = 0;
00644   m_setup_cleanup_tag = 0;
00645   m_setup_no_cleanup_tag = 0;
00646 }

void Project::clear_all (? ? )? [static]
?

Definition at line 355 of file cmt_project.cxx.

References cmt_vector< Project >::clear(), clear(), projects(), and cmt_vector< Project >::size().

Referenced by Database::clear(), and ProjectFactory::reset().

00356 {
00357   static ProjectVector& Projects = projects ();
00358 
00359   for (int i = 0; i < Projects.size (); i++)
00360     {
00361       Project& project = Projects[i];
00362       project.clear ();
00363     }
00364 
00365   Projects.clear ();
00366 }

void Project::configure (? ? )?
?

Definition at line 649 of file cmt_project.cxx.

References Tag::add(), Tag::add_tag_exclude(), Cmt::get_debug(), m_configured, m_keep_makefiles_tag, m_name, m_no_prototypes_tag, m_prototypes_tag, m_rebuild_makefiles_tag, m_setup_cleanup_tag, m_setup_config_tag, m_setup_no_cleanup_tag, m_setup_no_config_tag, m_setup_no_root_tag, m_setup_root_tag, m_with_installarea_tag, m_without_installarea_tag, Tag::mark(), and PriorityConfig.

Referenced by set_name().

00650 {
00651   /*
00652 
00653   _prototypes
00654   _no_prototypes
00655   _rebuild_makefile
00656   _keep_makefile
00657   _with_installarea
00658   _without_installarea
00659 
00660   _setup_config
00661   _setup_no_config
00662   _setup_root
00663   _setup_no_root
00664   _setup_cleanup
00665   _setup_no_cleanup
00666 
00667   */
00668 
00669   if (m_configured) return;
00670   m_configured = true;
00671 
00672   cmt_string tag_name;
00673 
00674   tag_name = m_name;
00675   tag_name += "_prototypes";
00676   m_prototypes_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00677   
00678   tag_name = m_name;
00679   tag_name += "_no_prototypes";
00680   m_no_prototypes_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00681   
00682   m_prototypes_tag->add_tag_exclude (m_no_prototypes_tag);
00683   m_no_prototypes_tag->add_tag_exclude (m_prototypes_tag);
00684   m_prototypes_tag->mark ();
00685   
00686   tag_name = m_name;
00687   tag_name += "_rebuild_makefiles";
00688   m_rebuild_makefiles_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00689   
00690   tag_name = m_name;
00691   tag_name += "_keep_makefiles";
00692   m_keep_makefiles_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00693   
00694   m_rebuild_makefiles_tag->add_tag_exclude (m_keep_makefiles_tag);
00695   m_keep_makefiles_tag->add_tag_exclude (m_rebuild_makefiles_tag);
00696   m_rebuild_makefiles_tag->mark ();
00697   
00698   tag_name = m_name;
00699   tag_name += "_with_installarea";
00700   m_with_installarea_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00701   
00702   tag_name = m_name;
00703   tag_name += "_without_installarea";
00704   m_without_installarea_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00705   
00706   m_with_installarea_tag->add_tag_exclude (m_without_installarea_tag);
00707   m_without_installarea_tag->add_tag_exclude (m_with_installarea_tag);
00708   m_with_installarea_tag->mark ();
00709 
00710 
00711 
00712   tag_name = m_name;
00713   tag_name += "_setup_config";
00714   m_setup_config_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00715   
00716   tag_name = m_name;
00717   tag_name += "_setup_no_config";
00718   m_setup_no_config_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00719   
00720   m_setup_config_tag->add_tag_exclude (m_setup_no_config_tag);
00721   m_setup_no_config_tag->add_tag_exclude (m_setup_config_tag);
00722   m_setup_config_tag->mark ();
00723 
00724   tag_name = m_name;
00725   tag_name += "_setup_root";
00726   m_setup_root_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00727   
00728   tag_name = m_name;
00729   tag_name += "_setup_no_root";
00730   m_setup_no_root_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00731   
00732   m_setup_root_tag->add_tag_exclude (m_setup_no_root_tag);
00733   m_setup_no_root_tag->add_tag_exclude (m_setup_root_tag);
00734   m_setup_root_tag->mark ();
00735 
00736   tag_name = m_name;
00737   tag_name += "_setup_cleanup";
00738   m_setup_cleanup_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00739   
00740   tag_name = m_name;
00741   tag_name += "_setup_no_cleanup";
00742   m_setup_no_cleanup_tag = Tag::add (tag_name, PriorityConfig, "PROJECT", 0);
00743   
00744   m_setup_cleanup_tag->add_tag_exclude (m_setup_no_cleanup_tag);
00745   m_setup_no_cleanup_tag->add_tag_exclude (m_setup_cleanup_tag);
00746   m_setup_cleanup_tag->mark ();
00747 
00748   if (Cmt::get_debug ())
00749     {
00750       cout << "Project::configure> " << m_name
00751            << " " << m_prototypes_tag
00752            << " " << m_no_prototypes_tag
00753            << " " << m_rebuild_makefiles_tag
00754            << " " << m_keep_makefiles_tag
00755            << " " << m_with_installarea_tag
00756            << " " << m_without_installarea_tag
00757            << " " << m_setup_config_tag
00758            << " " << m_setup_no_config_tag
00759            << " " << m_setup_root_tag
00760            << " " << m_setup_no_root_tag
00761            << " " << m_setup_cleanup_tag
00762            << " " << m_setup_no_cleanup_tag
00763            << endl;
00764     }
00765 }

void Project::create (? const cmt_string &? ? name )? [static]
?

Definition at line 208 of file cmt_project.cxx.

References CmtSystem::cd(), ProjectPatcher::commit(), Cmt::get_cmt_version(), get_project_file_name(), CmtSystem::mkdir(), cmt_string::read(), Awk::run(), CmtSystem::test_directory(), and CmtSystem::test_file().

Referenced by Cmt::do_create_project().

00209 {
00210   cout << "------------------------------------------" << endl;
00211   cout << "Configuring environment for project " << name << endl;
00212   cout << "CMT version " << Cmt::get_cmt_version () << "." << endl;
00213   cout << "------------------------------------------" << endl;
00214 
00215   if (!CmtSystem::test_directory ("cmt"))
00216     {
00217       if (!CmtSystem::mkdir ("cmt"))
00218         {
00219           cout << "Cannot create the cmt directory" << endl;
00220           return;
00221         }
00222       else
00223         {
00224           cout << "Installing the cmt directory" << endl;
00225         }
00226     }
00227 
00228   CmtSystem::cd ("cmt");
00229 
00230   if (!CmtSystem::test_file (get_project_file_name ()))
00231     {
00232       cout << "Creating a new project file" << endl;
00233 
00234       ofstream f (get_project_file_name ());
00235       if (f)
00236         {
00237           f << "project " << name << endl;
00238           f << endl;
00239           f.close ();
00240         }
00241     }
00242   else
00243     {
00244       cmt_string text;
00245       text.read (get_project_file_name ());
00246 
00247       ProjectPatcher p (name);
00248 
00249       p.run (text);
00250       p.commit ();
00251 
00252       cout << "project file already there" << endl;
00253     }
00254 }

void Project::fill_selection (? int? ? depth,
CmtSystem::cmt_string_vector &? ? path_selections
)? [static]
?

Definition at line 424 of file cmt_project.cxx.

References cmt_vector< cmt_string >::add(), get_cmtpath(), get_cmtpath_pwd(), get_cmtpath_source(), projects(), and cmt_vector< Project >::size().

Referenced by Cmt::do_broadcast().

00425 {
00426   static ProjectVector& Projects = projects ();
00427 
00428   for (int i = 0; i < Projects.size (); i++)
00429     {
00430       Project& project = Projects[i];
00431 
00432       const cmt_string& p = project.get_cmtpath ();
00433       const cmt_string& pwd = project.get_cmtpath_pwd ();
00434       const cmt_string& src = project.get_cmtpath_source ();
00435 
00436       if (src != "default path")
00437         {
00438           if (depth > 0)
00439             {
00440               cmt_string& s1 = path_selections.add ();
00441               s1 = p;
00442               cmt_string& s2 = path_selections.add ();
00443               s2 = pwd;
00444               depth--;
00445 
00446               if (depth == 0) break;
00447             }
00448         }
00449     }
00450 }

Project * Project::find_by_cmtpath (? const cmt_string &? ? cmtpath )? [static]
?

Definition at line 272 of file cmt_project.cxx.

References CmtSystem::compress_path(), m_cmtpath, m_cmtpath_pwd, projects(), and cmt_vector< Project >::size().

Referenced by KwdSetupStrategy::action(), KwdBuildStrategy::action(), and Use::fill_standard_macros().

00273 {
00274   cmt_string compressed_path = cmtpath;
00275   CmtSystem::compress_path (compressed_path);
00276 
00277   static ProjectVector& Projects = projects ();
00278 
00279   for (int i = 0; i < Projects.size (); i++)
00280     {
00281       Project& p = Projects[i];
00282 
00283       if (p.m_cmtpath == compressed_path) return (&p);
00284       if (p.m_cmtpath_pwd == compressed_path) return (&p);
00285     }
00286 
00287   return (0);
00288 }

Project * Project::find_by_name (? const cmt_string &? ? name )? [static]
?

Definition at line 257 of file cmt_project.cxx.

References m_name, projects(), and cmt_vector< Project >::size().

Referenced by add().

00258 {
00259   static ProjectVector& Projects = projects ();
00260 
00261   for (int i = 0; i < Projects.size (); i++)
00262     {
00263       Project& p = Projects[i];
00264 
00265       if (p.m_name == name) return (&p);
00266     }
00267 
00268   return (0);
00269 }

cmt_string Project::find_in_cmt_paths (? const cmt_string &? ? path )? [static]
?

Definition at line 507 of file cmt_project.cxx.

References cmt_string::find(), m_cmtpath, m_cmtpath_pwd, m_cmtpath_source, cmt_string::npos, projects(), CmtSystem::pwd(), cmt_vector< Project >::size(), and CmtSystem::test_directory().

Referenced by CmtInstallAreaMgr::build_current_installarea(), Cmt::configure_current_cmtpath(), Cmt::do_broadcast(), and Use::get_cmtpath_and_offset().

00508 {
00509   const cmt_string pwd = CmtSystem::pwd ();
00510 
00511   static ProjectVector& Projects = projects ();
00512 
00513   for (int i = 0; i < Projects.size (); i++)
00514     {
00515       const Project& project = Projects[i];
00516 
00517       const cmt_string& p = project.m_cmtpath;
00518       const cmt_string& w = project.m_cmtpath_pwd;
00519       const cmt_string& s = project.m_cmtpath_source;
00520 
00521       if (s == "default path") continue;
00522 
00523       if (CmtSystem::test_directory (p))
00524         {
00525           if (path.find (p) != cmt_string::npos)
00526             {
00527               return (p);
00528             }
00529 
00530           // To become the current area, a path must correspond to the current package
00531           if (path.find (w) != cmt_string::npos)
00532             {
00533               return (p);
00534             }
00535         }
00536 
00537       if (p == w) continue;
00538 
00539       if (CmtSystem::test_directory (w))
00540         {
00541           if (path.find (w) != cmt_string::npos)
00542             {
00543               return (w);
00544             }
00545         }
00546     }
00547 
00548   return ("");
00549 }

int Project::get_build_strategy (? ? )?
?

Definition at line 819 of file cmt_project.cxx.

References Cmt::get_current_build_strategy(), m_build_strategy, m_build_strategy_mask, m_predecessor, and m_reference.

Referenced by Cmt::do_show_strategies(), and get_build_strategy().

00820 {
00821   int result = 0;
00822 
00823   if (m_reference != 0) result = m_reference->get_build_strategy ();
00824   else if (m_predecessor != 0) result = m_predecessor->get_build_strategy ();
00825   else result = Cmt::get_current_build_strategy ();
00826 
00827   if (m_build_strategy_mask != 0)
00828     {
00829       result &= ~m_build_strategy_mask;
00830       result |= m_build_strategy;
00831     }
00832 
00833   return (result);
00834 }

const cmt_string & Project::get_cmtpath (? ? )?
?

Definition at line 564 of file cmt_project.cxx.

Referenced by ProjectFactory::create_project(), fill_selection(), UseProjectAction::run(), CmtPathPatternProjectAction::run(), and show_paths().

00565 {
00566   return (m_cmtpath);
00567 }

const cmt_string & Project::get_cmtpath_pwd (? ? )?
?

Definition at line 570 of file cmt_project.cxx.

Referenced by ProjectFactory::create_project(), and fill_selection().

00571 {
00572   return (m_cmtpath_pwd);
00573 }

const cmt_string & Project::get_cmtpath_source (? ? )?
?

Definition at line 576 of file cmt_project.cxx.

Referenced by fill_selection(), CmtPathPatternProjectAction::run(), and show_paths().

00577 {
00578   return (m_cmtpath_source);
00579 }

Project * Project::get_current (? ? )? [static]
?

Definition at line 291 of file cmt_project.cxx.

References cmt_string::find(), m_cmtpath, m_cmtpath_pwd, projects(), CmtSystem::pwd(), and cmt_vector< Project >::size().

Referenced by Cmt::do_show_strategies(), StandardMacroBuilder::fill_for_project(), get_build_strategy(), get_setup_strategy(), and Cmt::print_context().

00292 {
00293   cmt_string here = CmtSystem::pwd ();
00294 
00295   static ProjectVector& Projects = projects ();
00296 
00297   Project* result = 0;
00298 
00299   for (int i = (Projects.size () - 1); i >= 0; i--)
00300     {
00301       Project& p = Projects[i];
00302 
00303       if (here.find (p.m_cmtpath_pwd) == 0) 
00304         {
00305           result = &p;
00306         }
00307 
00308       if (here.find (p.m_cmtpath) == 0) 
00309         {
00310           result = &p;
00311         }
00312     }
00313 
00314   return (result);
00315 }

const cmt_string & Project::get_name (? ? )?
?

Definition at line 558 of file cmt_project.cxx.

Referenced by KwdSetupStrategy::action(), KwdBuildStrategy::action(), ProjectFactory::create_project(), SyntaxParser::do_parse_words(), StandardMacroBuilder::fill_for_project(), Use::fill_standard_macros(), and CmtPathPatternProjectAction::run().

00559 {
00560   return (m_name);
00561 }

const cmt_string & Project::get_project_file_name (? ? )? [static]
?

Definition at line 416 of file cmt_project.cxx.

Referenced by ProjectPatcher::commit(), create(), and ProjectFactory::create_project().

00417 {
00418   static const cmt_string name = "project.cmt";
00419 
00420   return (name);
00421 }

int Project::get_setup_strategy (? ? )?
?

Definition at line 837 of file cmt_project.cxx.

References Cmt::get_current_setup_strategy(), m_predecessor, m_reference, m_setup_strategy, and m_setup_strategy_mask.

Referenced by get_setup_strategy().

00838 {
00839   int result = 0;
00840 
00841   if (m_reference != 0) result = m_reference->get_setup_strategy ();
00842   else if (m_predecessor != 0) result = m_predecessor->get_setup_strategy ();
00843   else result = Cmt::get_current_setup_strategy ();
00844 
00845   if (m_setup_strategy_mask != 0)
00846     {
00847       result &= ~m_setup_strategy_mask;
00848       result |= m_setup_strategy;
00849     }
00850 
00851   return (result);
00852 }

bool Project::operator!= (? const cmt_string &? ? name )? const
?

Definition at line 785 of file cmt_project.cxx.

References m_name.

00786 {
00787   return ((m_name != name));
00788 }

Project & Project::operator= (? const Project &? ? other )?
?

Definition at line 768 of file cmt_project.cxx.

References m_cmtpath, m_cmtpath_pwd, m_cmtpath_source, and m_name.

00769 {
00770   m_name = other.m_name;
00771   m_cmtpath = other.m_cmtpath;
00772   m_cmtpath_pwd = other.m_cmtpath_pwd;
00773   m_cmtpath_source = other.m_cmtpath_source;
00774 
00775   return (*this);
00776 }

bool Project::operator== (? const cmt_string &? ? name )? const
?

Definition at line 779 of file cmt_project.cxx.

References m_name.

00780 {
00781   return ((m_name == name));
00782 }

Project::ProjectVector & Project::projects (? ? )? [static]
?

Definition at line 346 of file cmt_project.cxx.

References Database::instance(), and Database::projects().

Referenced by add(), broadcast(), clear_all(), ProjectFactory::create_project(), fill_selection(), find_by_cmtpath(), find_by_name(), find_in_cmt_paths(), get_current(), reverse_broadcast(), scan_paths(), scan_paths_for_package(), set_build_strategy(), set_setup_strategy(), show_all(), and show_paths().

00347 {
00348   static Database& db = Database::instance ();
00349   static ProjectVector& Projects = db.projects ();
00350 
00351   return (Projects);
00352 }

void Project::reverse_broadcast (? IProjectAction &? ? action )? [static]
?

Definition at line 466 of file cmt_project.cxx.

References projects(), IProjectAction::run(), and cmt_vector< Project >::size().

Referenced by CmtPathPattern::apply().

00467 {
00468   static ProjectVector& Projects = projects ();
00469 
00470   for (int i = (Projects.size () - 1); i >= 0; i--)
00471     {
00472       const Project& project = Projects[i];
00473 
00474       if (!action.run (project)) break;
00475     }
00476 }

void Project::scan_paths (? PathScanner &? ? scanner,
PathScanner::actor &? ? actor
)? [static]
?

Definition at line 479 of file cmt_project.cxx.

References m_cmtpath, projects(), PathScanner::scan_path(), and cmt_vector< Project >::size().

Referenced by Cmt::do_broadcast(), Cmt::do_show_clients(), and Cmt::do_show_packages().

00480 {
00481   static ProjectVector& Projects = projects ();
00482 
00483   for (int i = 0; i < Projects.size (); i++)
00484     {
00485       const Project& project = Projects[i];
00486 
00487       const cmt_string& p = project.m_cmtpath;
00488       scanner.scan_path (p, a);
00489     }
00490 }

void Project::scan_paths_for_package (? PathScanner &? ? scanner,
const cmt_string &? ? name
)? [static]
?

Definition at line 493 of file cmt_project.cxx.

References m_cmtpath, projects(), PathScanner::scan_package(), and cmt_vector< Project >::size().

Referenced by Cmt::do_show_versions().

00494 {
00495   static ProjectVector& Projects = projects ();
00496 
00497   for (int i = 0; i < Projects.size (); i++)
00498     {
00499       const Project& project = Projects[i];
00500 
00501       const cmt_string& p = project.m_cmtpath;
00502       scanner.scan_package (p, name);
00503     }
00504 }

void Project::set_build_strategy (? int? ? mask,
int? ? strategy
)?
?

Definition at line 855 of file cmt_project.cxx.

References Tag::find(), KeepMakefiles, m_build_strategy, m_build_strategy_mask, m_name, m_predecessor, m_reference, Tag::mark(), NoPrototypes, projects(), Prototypes, RebuildMakefiles, cmt_vector< Project >::size(), Tag::unmark(), WithInstallArea, and WithoutInstallArea.

Referenced by KwdBuildStrategy::action().

00856 {
00857   m_build_strategy_mask |= mask;
00858   m_build_strategy &= ~mask;
00859   m_build_strategy |= strategy;
00860 
00861   cmt_string to_tag_name = m_name;
00862   cmt_string to_untag_name = m_name;
00863 
00864   Tag* to_tag = 0;
00865   Tag* to_untag = 0;
00866 
00867   switch (strategy)
00868     {
00869     case Prototypes:
00870       to_tag_name += "_prototypes";
00871       to_untag_name += "_no_prototypes";
00872       break;
00873     case NoPrototypes:
00874       to_tag_name += "_no_prototypes";
00875       to_untag_name += "_prototypes";
00876       break;
00877     case RebuildMakefiles:
00878       to_tag_name += "_rebuild_makefiles";
00879       to_untag_name += "_keep_makefiles";
00880       break;
00881     case KeepMakefiles:
00882       to_tag_name += "_keep_makefiles";
00883       to_untag_name += "_rebuild_makefiles";
00884       break;
00885     case WithInstallArea:
00886       to_tag_name += "_with_installarea";
00887       to_untag_name += "_without_installarea";
00888       break;
00889     case WithoutInstallArea:
00890       to_tag_name += "_without_installarea";
00891       to_untag_name += "_with_installarea";
00892       break;
00893     }
00894 
00895   to_tag = Tag::find (to_tag_name);
00896   to_untag = Tag::find (to_untag_name);
00897 
00898   if (to_untag != 0)
00899     {
00900       to_untag->unmark ();
00901     }
00902 
00903   if (to_tag != 0)
00904     {
00905       to_tag->mark ();
00906     }
00907 
00908   static ProjectVector& Projects = projects ();
00909 
00910   for (int i = 0; i < Projects.size (); i++)
00911     {
00912       Project& project = Projects[i];
00913 
00914       if ((project.m_predecessor == this) ||
00915           (project.m_reference == this))
00916         {
00917           if ((project.m_build_strategy_mask & mask) == 0)
00918             {
00919               project.set_build_strategy (mask, strategy);
00920             }
00921         }
00922     }
00923 
00924 }

void Project::set_cmtpath (? const cmt_string &? ? path )?
?

Definition at line 589 of file cmt_project.cxx.

References m_cmtpath.

Referenced by ProjectFactory::create_project().

00590 {
00591   m_cmtpath = path;
00592 }

void Project::set_cmtpath_pwd (? const cmt_string &? ? path )?
?

Definition at line 595 of file cmt_project.cxx.

References m_cmtpath_pwd.

Referenced by ProjectFactory::create_project().

00596 {
00597   m_cmtpath_pwd = path;
00598 }

void Project::set_cmtpath_source (? const cmt_string &? ? source )?
?

Definition at line 601 of file cmt_project.cxx.

References m_cmtpath_source.

Referenced by ProjectFactory::create_project().

00602 {
00603   m_cmtpath_source = source;
00604 }

void Project::set_name (? const cmt_string &? ? new_name )?
?

Definition at line 582 of file cmt_project.cxx.

References configure(), and m_name.

Referenced by add().

00583 {
00584   m_name = name;
00585   configure ();
00586 }

void Project::set_predecessor (? Project *? ? predecessor )?
?

Definition at line 607 of file cmt_project.cxx.

References m_predecessor.

Referenced by ProjectFactory::create_project().

00608 {
00609   m_predecessor = predecessor;
00610 }

void Project::set_reference (? Project *? ? reference )?
?

Definition at line 613 of file cmt_project.cxx.

References m_reference.

Referenced by add().

00614 {
00615   m_reference = reference;
00616 }

void Project::set_setup_strategy (? int? ? mask,
int? ? strategy
)?
?

Definition at line 927 of file cmt_project.cxx.

References Tag::find(), m_name, m_predecessor, m_reference, m_setup_strategy, m_setup_strategy_mask, Tag::mark(), projects(), SetupCleanup, SetupConfig, SetupNoCleanup, SetupNoConfig, SetupNoRoot, SetupRoot, cmt_vector< Project >::size(), and Tag::unmark().

Referenced by KwdSetupStrategy::action().

00928 {
00929   m_setup_strategy_mask |= mask;
00930   m_setup_strategy &= ~mask;
00931   m_setup_strategy |= strategy;
00932 
00933   cmt_string to_tag_name = m_name;
00934   cmt_string to_untag_name = m_name;
00935 
00936   Tag* to_tag = 0;
00937   Tag* to_untag = 0;
00938 
00939   switch (strategy)
00940     {
00941     case SetupConfig:
00942       to_tag_name += "_setup_config";
00943       to_untag_name += "_setup_no_config";
00944       break;
00945     case SetupNoConfig:
00946       to_tag_name += "_setup_no_config";
00947       to_untag_name += "_setup_config";
00948       break;
00949     case SetupRoot:
00950       to_tag_name += "_setup_root";
00951       to_untag_name += "_setup_no_root";
00952       break;
00953     case SetupNoRoot:
00954       to_tag_name += "_setup_no_root";
00955       to_untag_name += "_setup_root";
00956       break;
00957     case SetupCleanup:
00958       to_tag_name += "_setup_cleanup";
00959       to_untag_name += "_setup_no_cleanup";
00960       break;
00961     case SetupNoCleanup:
00962       to_tag_name += "_setup_no_cleanup";
00963       to_untag_name += "_setup_cleanup";
00964       break;
00965     }
00966 
00967   to_tag = Tag::find (to_tag_name);
00968   to_untag = Tag::find (to_untag_name);
00969 
00970   if (to_untag != 0)
00971     {
00972       to_untag->unmark ();
00973     }
00974 
00975   if (to_tag != 0)
00976     {
00977       to_tag->mark ();
00978     }
00979 
00980   static ProjectVector& Projects = projects ();
00981 
00982   for (int i = 0; i < Projects.size (); i++)
00983     {
00984       Project& project = Projects[i];
00985 
00986       if ((project.m_predecessor == this) ||
00987           (project.m_reference == this))
00988         {
00989           if ((project.m_setup_strategy_mask & mask) == 0)
00990             {
00991               project.set_setup_strategy (mask, strategy);
00992             }
00993         }
00994     }
00995 }

void Project::show (? ? )?
?

Definition at line 791 of file cmt_project.cxx.

References cmt_string::find(), m_cmtpath, m_cmtpath_source, m_name, and CmtSystem::pwd().

Referenced by Cmt::do_show_strategies(), and show_all().

00792 {
00793   bool is_current = false;
00794 
00795   cmt_string here = CmtSystem::pwd ();
00796 
00797   if (here.find (m_cmtpath) == 0) 
00798     {
00799       if (m_cmtpath_source != "default path")
00800         {
00801           is_current = true;
00802         }
00803     }
00804 
00805   cout << m_name << " (in " << m_cmtpath << ")";
00806 
00807   if (is_current) cout << " (current)";
00808 
00809   cout << endl;
00810 }

void Project::show_all (? ? )? [static]
?

Definition at line 369 of file cmt_project.cxx.

References projects(), show(), and cmt_vector< Project >::size().

Referenced by Cmt::do_show_projects().

00370 {
00371   static ProjectVector& Projects = projects ();
00372 
00373   for (int i = 0; i < Projects.size (); i++)
00374     {
00375       const Project& project = Projects[i];
00376       project.show ();
00377     }
00378 }

void Project::show_paths (? ? )? [static]
?

Definition at line 381 of file cmt_project.cxx.

References get_cmtpath(), get_cmtpath_source(), Cmt::get_quiet(), CmtSystem::path_separator(), projects(), and cmt_vector< Project >::size().

Referenced by Cmt::do_show_path().

00382 {
00383   static ProjectVector& Projects = projects ();
00384 
00385   if (!Cmt::get_quiet ())
00386     {
00387       for (int i = 0; i < Projects.size (); i++)
00388         {
00389           const Project& project = Projects[i];
00390 
00391           const cmt_string& path   = project.get_cmtpath ();
00392           const cmt_string& source = project.get_cmtpath_source ();
00393           
00394           cout << "# Add path " << path << " from " << source << endl;
00395         }
00396       
00397       cout << "#" << endl;
00398     }
00399 
00400   for (int i = 0; i < Projects.size (); i++)
00401     {
00402       const Project& project = Projects[i];
00403       
00404       const cmt_string& path   = project.get_cmtpath ();
00405       const cmt_string& source = project.get_cmtpath_source ();
00406 
00407       if (i > 0) cout << CmtSystem::path_separator ();
00408 
00409       cout << path;
00410     }
00411 
00412   cout << endl;
00413 }

void Project::show_strategies (? ? )?
?

Definition at line 814 of file cmt_project.cxx.

00815 {
00816 }

Member Data Documentation

int Project::m_build_strategy [private]
?

Definition at line 105 of file cmt_project.h.

Referenced by clear(), get_build_strategy(), and set_build_strategy().

int Project::m_build_strategy_mask [private]
?

Definition at line 104 of file cmt_project.h.

Referenced by clear(), get_build_strategy(), and set_build_strategy().

cmt_string Project::m_cmtpath [private]
?

Definition at line 100 of file cmt_project.h.

Referenced by clear(), find_by_cmtpath(), find_in_cmt_paths(), get_current(), operator=(), scan_paths(), scan_paths_for_package(), set_cmtpath(), and show().

cmt_string Project::m_cmtpath_pwd [private]
?

Definition at line 101 of file cmt_project.h.

Referenced by clear(), find_by_cmtpath(), find_in_cmt_paths(), get_current(), operator=(), and set_cmtpath_pwd().

cmt_string Project::m_cmtpath_source [private]
?

Definition at line 102 of file cmt_project.h.

Referenced by clear(), find_in_cmt_paths(), operator=(), set_cmtpath_source(), and show().

bool Project::m_configured [private]
?

Definition at line 109 of file cmt_project.h.

Referenced by clear(), and configure().

Tag* Project::m_keep_makefiles_tag [private]
?

Definition at line 114 of file cmt_project.h.

Referenced by clear(), and configure().

cmt_string Project::m_name [private]
?

Definition at line 95 of file cmt_project.h.

Referenced by clear(), configure(), find_by_name(), operator!=(), operator=(), operator==(), set_build_strategy(), set_name(), set_setup_strategy(), and show().

Tag* Project::m_no_prototypes_tag [private]
?

Definition at line 112 of file cmt_project.h.

Referenced by clear(), and configure().

Project* Project::m_predecessor [private]
?

Definition at line 98 of file cmt_project.h.

Referenced by get_build_strategy(), get_setup_strategy(), set_build_strategy(), set_predecessor(), and set_setup_strategy().

Tag* Project::m_prototypes_tag [private]
?

Definition at line 111 of file cmt_project.h.

Referenced by clear(), and configure().

Tag* Project::m_rebuild_makefiles_tag [private]
?

Definition at line 113 of file cmt_project.h.

Referenced by clear(), and configure().

Project* Project::m_reference [private]
?

Definition at line 97 of file cmt_project.h.

Referenced by get_build_strategy(), get_setup_strategy(), set_build_strategy(), set_reference(), and set_setup_strategy().

Tag* Project::m_setup_cleanup_tag [private]
?

Definition at line 122 of file cmt_project.h.

Referenced by clear(), and configure().

Tag* Project::m_setup_config_tag [private]
?

Definition at line 118 of file cmt_project.h.

Referenced by clear(), and configure().

Tag* Project::m_setup_no_cleanup_tag [private]
?

Definition at line 123 of file cmt_project.h.

Referenced by clear(), and configure().

Tag* Project::m_setup_no_config_tag [private]
?

Definition at line 119 of file cmt_project.h.

Referenced by clear(), and configure().

Tag* Project::m_setup_no_root_tag [private]
?

Definition at line 121 of file cmt_project.h.

Referenced by clear(), and configure().

Tag* Project::m_setup_root_tag [private]
?

Definition at line 120 of file cmt_project.h.

Referenced by clear(), and configure().

int Project::m_setup_strategy [private]
?

Definition at line 107 of file cmt_project.h.

Referenced by clear(), get_setup_strategy(), and set_setup_strategy().

int Project::m_setup_strategy_mask [private]
?

Definition at line 106 of file cmt_project.h.

Referenced by clear(), get_setup_strategy(), and set_setup_strategy().

Tag* Project::m_with_installarea_tag [private]
?

Definition at line 115 of file cmt_project.h.

Referenced by clear(), and configure().

Tag* Project::m_without_installarea_tag [private]
?

Definition at line 116 of file cmt_project.h.

Referenced by clear(), and configure().


The documentation for this class was generated from the following files:
Generated on Wed Sep 1 11:00:50 2004 for CMT by 1.2.18