Changeset 9
- Timestamp:
- Mar 4, 2005, 6:20:46 PM (19 years ago)
- Location:
- CMT/v1r19
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/v1r19/ChangeLog
r8 r9 1 2005-03-04 Christian Arnault <arnault@lal.in2p3.fr> 256 2 3 * source/cmt_project.cxx: Ongoing work for redefining Project graphs. 4 1 5 2005-03-03 Christian Arnault <arnault@lal.in2p3.fr> 255 2 6 -
CMT/v1r19/source/cmt.h
r2 r9 64 64 bool m_standard_macros_done; 65 65 bool m_all_sets_done; 66 67 bool m_autoconfigure_cmtpath; 66 68 }; 67 69 -
CMT/v1r19/source/cmt_commands.cxx
r3 r9 178 178 parsers.add ("--version", i); 179 179 pv.push_back (&ArgParser::do_version); i++; 180 181 parsers.add ("+p", i);182 parsers.add ("+pa", i);183 parsers.add ("+pat", i);184 parsers.add ("+path", i);185 pv.push_back (&ArgParser::do_add_path); i++;186 180 187 181 parsers.add ("-b", i); … … 1550 1544 { 1551 1545 cmt.m_action = action_version; 1552 }1553 1554 void ArgParser::do_add_path ()1555 {1556 cmt_string here = CmtSystem::pwd ();1557 1558 if (CmtSystem::cd (arg))1559 {1560 arg = CmtSystem::pwd ();1561 1562 //cerr << "Adding path " << arg << endl;1563 1564 IProjectFactory& factory = ProjectFactory::instance ();1565 CmtSystem::add_cmt_path (arg, "argument", factory);1566 CmtSystem::cd (here);1567 }1568 1546 } 1569 1547 -
CMT/v1r19/source/cmt_commands.h
r2 r9 57 57 void do_unlock (); 58 58 void do_version (); 59 void do_add_path ();60 59 void option_help (); 61 60 void option_n (); -
CMT/v1r19/source/cmt_parser.cxx
r8 r9 89 89 m_current_structuring_style = with_version_directory; 90 90 m_all_sets_done = false; 91 m_autoconfigure_cmtpath = false; 91 92 m_debug = false; 92 93 if (getenv ("CMTDEBUG") != 0) m_debug = true; … … 585 586 void Cmt::configure_cmt_path (Use* use) 586 587 { 588 if (!Me.m_autoconfigure_cmtpath) return; 589 587 590 cmt_string s; 588 591 … … 611 614 factory.reset (); 612 615 613 CmtSystem::get_cmt_paths (factory, s); 614 615 if (Me.m_cmt_user_context != "") factory.create_project (Me.m_cmt_user_context, "CMTUSERCONTEXT"); 616 if (Me.m_cmt_home != "") factory.create_project (Me.m_cmt_home, "CMTHOME"); 616 CmtSystem::get_cmt_paths (factory, s, Me.m_cmt_user_context, Me.m_cmt_home); 617 617 } 618 618 … … 3909 3909 3910 3910 IProjectFactory& factory = ProjectFactory::instance (); 3911 factory.create_project (pwd, "CurrentProject" );3911 factory.create_project (pwd, "CurrentProject", 0); 3912 3912 3913 3913 /* … … 3939 3939 3940 3940 cmt_string buffer = "path CMTPATH \n"; 3941 Project:: set_cmtpaths (buffer);3941 Project::fill_cmtpaths (buffer); 3942 3942 //cerr << "buffer = " << buffer << endl; 3943 3943 Use& use = Use::current(); … … 3946 3946 SyntaxParser::parse_requirements_text (buffer, "", &use); 3947 3947 Me.m_quiet = save_quiet; 3948 3949 Me.m_autoconfigure_cmtpath = true; 3948 3950 } 3949 3951 -
CMT/v1r19/source/cmt_project.cxx
r8 r9 105 105 - then it tries to read and parse its project file 106 106 */ 107 void ProjectFactory::create_project (const cmt_string& path, 108 const cmt_string& source) 107 Project* ProjectFactory::create_project (const cmt_string& path, 108 const cmt_string& source, 109 Project* parent) 109 110 { 110 111 cmt_string compressed_path = path; … … 117 118 Project& p = Projects[i]; 118 119 119 if (p.get_cmtpath () == compressed_path) return; 120 if (p.get_cmtpath_pwd () == compressed_path) return; 120 if ((p.get_cmtpath () == compressed_path) || 121 (p.get_cmtpath_pwd () == compressed_path)) 122 { 123 if (parent != 0) 124 { 125 p.add_parent (parent); 126 parent->add_child (&p); 127 } 128 return (&p); 129 } 121 130 } 122 131 … … 127 136 128 137 cmt_string here = CmtSystem::pwd (); 129 if (!CmtSystem::cd (compressed_path)) return ;138 if (!CmtSystem::cd (compressed_path)) return (0); 130 139 131 140 cmt_string name; … … 187 196 project = Project::add (name, release); 188 197 198 if (parent != 0) 199 { 200 project->add_parent (parent); 201 parent->add_child (project); 202 } 203 189 204 if (source == "default path") 190 205 { … … 216 231 } 217 232 218 if (m_previous != 0) m_previous->set_predecessor (project);219 m_previous = project;220 221 233 if (text != "") 222 234 { … … 229 241 230 242 CmtSystem::cd (here); 243 244 return (project); 231 245 } 232 246 … … 374 388 Project& p = Projects.add (); 375 389 376 project->set_reference (&p);377 390 p.set_name (name); 378 391 p.set_release (release); … … 417 430 void Project::show_all () 418 431 { 432 /* 419 433 static ProjectVector& Projects = projects (); 420 434 … … 424 438 project.show (); 425 439 } 426 } 440 */ 441 442 static Project::ProjectVector& Projects = Project::projects (); 443 444 for (int i = 0; i < Projects.size (); i++) 445 { 446 Project& p = Projects[i]; 447 p.m_visited = false; 448 } 449 450 Project* current = get_current (); 451 452 current->show (); 453 454 455 } 456 457 class VisitorForShowPaths : public IProjectVisitor 458 { 459 public: 460 VisitorForShowPaths () 461 { 462 } 463 464 void pre (Project* p) 465 { 466 const cmt_string& w = p->get_cmtpath_pwd (); 467 const cmt_string& s = p->get_cmtpath_source (); 468 469 if (s == "default path") return; 470 471 if (CmtSystem::test_directory (w)) 472 { 473 cout << "# Add path " << w << " from " << s << endl; 474 } 475 } 476 477 void in (Project* p) 478 { 479 const cmt_string& w = p->get_cmtpath_pwd (); 480 const cmt_string& s = p->get_cmtpath_source (); 481 482 if (s == "default path") return; 483 484 if (CmtSystem::test_directory (w)) 485 { 486 cout << "# Add path " << w << " from " << s << endl; 487 } 488 } 489 490 void post (Project* p) 491 { 492 } 493 }; 427 494 428 495 /*----------------------------------------------------------*/ 429 496 void Project::show_paths () 430 497 { 431 static ProjectVector& Projects = projects (); 432 433 if (!Cmt::get_quiet ()) 434 { 435 for (int i = 0; i < Projects.size (); i++) 436 { 437 const Project& project = Projects[i]; 438 439 const cmt_string& path = project.get_cmtpath (); 440 const cmt_string& source = project.get_cmtpath_source (); 441 442 cout << "# Add path " << path << " from " << source << endl; 443 } 444 445 cout << "#" << endl; 446 } 447 448 for (int i = 0; i < Projects.size (); i++) 449 { 450 const Project& project = Projects[i]; 451 452 const cmt_string& path = project.get_cmtpath (); 453 const cmt_string& source = project.get_cmtpath_source (); 454 455 if (i > 0) cout << CmtSystem::path_separator (); 456 457 cout << path; 458 } 459 460 cout << endl; 498 VisitorForShowPaths visitor; 499 500 start_visit (visitor); 461 501 } 462 502 … … 598 638 599 639 //---------------------------------------------------------- 600 void Project::set_cmtpaths (cmt_string& buffer) 640 void Project::visit (IProjectVisitor& visitor) 641 { 642 if (m_visited) return; 643 m_visited = true; 644 645 int i; 646 647 for (i = 0; i < get_children_size (); i++) 648 { 649 Project* child = get_child (i); 650 651 if (child->visited ()) continue; 652 653 visitor.in (child); 654 } 655 656 for (i = 0; i < m_children.size (); i++) 657 { 658 Project* child = m_children[i]; 659 child->visit (visitor); 660 } 661 } 662 663 //---------------------------------------------------------- 664 void Project::start_visit (IProjectVisitor& visitor) 665 { 666 static Project::ProjectVector& Projects = Project::projects (); 667 668 for (int i = 0; i < Projects.size (); i++) 669 { 670 Project& p = Projects[i]; 671 p.m_visited = false; 672 } 673 674 Project* p = get_current (); 675 676 if (p == 0) return; 677 678 visitor.pre (p); 679 p->visit (visitor); 680 visitor.post (p); 681 } 682 683 //---------------------------------------------------------- 684 class VisitorForFillCMTPATH : public IProjectVisitor 685 { 686 public: 687 VisitorForFillCMTPATH (cmt_string& buffer) : m_buffer (buffer) 688 { 689 } 690 691 void pre (Project* p) 692 { 693 const cmt_string& w = p->get_cmtpath_pwd (); 694 const cmt_string& s = p->get_cmtpath_source (); 695 696 if (s == "default path") return; 697 698 if (CmtSystem::test_directory (w)) 699 { 700 m_buffer += "path_append CMTPATH \""; 701 m_buffer += w; 702 m_buffer += "\" \n"; 703 } 704 } 705 706 void in (Project* p) 707 { 708 const cmt_string& w = p->get_cmtpath_pwd (); 709 const cmt_string& s = p->get_cmtpath_source (); 710 711 if (s == "default path") return; 712 713 if (CmtSystem::test_directory (w)) 714 { 715 m_buffer += "path_append CMTPATH \""; 716 m_buffer += w; 717 m_buffer += "\" \n"; 718 } 719 } 720 721 void post (Project* p) 722 { 723 //cerr << "Buffer = " << m_buffer << endl; 724 } 725 726 private: 727 cmt_string& m_buffer; 728 729 }; 730 731 //---------------------------------------------------------- 732 void Project::fill_cmtpaths (cmt_string& buffer) 601 733 { 602 734 /* … … 606 738 */ 607 739 608 static ProjectVector& Projects = projects (); 609 610 for (int i = 0; i < Projects.size (); i++) 611 { 612 const Project& project = Projects[i]; 613 614 const cmt_string& p = project.m_cmtpath; 615 const cmt_string& w = project.m_cmtpath_pwd; 616 const cmt_string& s = project.m_cmtpath_source; 617 618 if (s == "default path") continue; 619 620 if (CmtSystem::test_directory (w)) 621 { 622 buffer += "path_append CMTPATH \""; 623 buffer += w; 624 buffer += "\" \n"; 625 } 626 } 627 } 628 629 //---------------------------------------------------------- 630 Project::Project () : m_name (""), m_reference (0), m_predecessor (0) 740 VisitorForFillCMTPATH visitor (buffer); 741 742 start_visit (visitor); 743 } 744 745 //---------------------------------------------------------- 746 Project::Project () : m_name ("") 631 747 { 632 748 clear (); … … 664 780 665 781 //---------------------------------------------------------- 782 int Project::get_children_size () const 783 { 784 return (m_children.size ()); 785 } 786 787 //---------------------------------------------------------- 788 Project* Project::get_child (int index) const 789 { 790 if (index < 0) return (0); 791 if (index >= m_children.size ()) return (0); 792 return (m_children[index]); 793 } 794 795 //---------------------------------------------------------- 796 bool Project::visited () const 797 { 798 return (m_visited); 799 } 800 801 //---------------------------------------------------------- 666 802 void Project::set_name (const cmt_string& name) 667 803 { 668 804 m_name = name; 669 configure ();805 //configure (); 670 806 } 671 807 … … 692 828 { 693 829 m_cmtpath_source = source; 694 }695 696 //----------------------------------------------------------697 void Project::set_predecessor (Project* predecessor)698 {699 m_predecessor = predecessor;700 }701 702 //----------------------------------------------------------703 void Project::set_reference (Project* reference)704 {705 m_reference = reference;706 830 } 707 831 … … 714 838 m_cmtpath_pwd = ""; 715 839 m_cmtpath_source = ""; 840 841 m_parents.clear (); 842 m_children.clear (); 716 843 717 844 m_build_strategy_mask = 0; … … 733 860 m_setup_cleanup_tag = 0; 734 861 m_setup_no_cleanup_tag = 0; 862 } 863 864 //---------------------------------------------------------- 865 void Project::add_parent (Project* p) 866 { 867 if (p == 0) return; 868 869 int i; 870 871 for (i = 0; i < m_children.size (); i++) 872 { 873 Project* child = m_children[i]; 874 if (child == 0) continue; 875 876 if (child->get_name () == p->get_name ()) 877 { 878 // Already registered as a child (no cycle permitted!!) 879 return; 880 } 881 } 882 883 for (i = 0; i < m_parents.size (); i++) 884 { 885 Project* parent = m_parents[i]; 886 if (parent == 0) continue; 887 888 if (parent->get_name () == p->get_name ()) 889 { 890 // Already registered 891 return; 892 } 893 } 894 895 m_parents.push_back (p); 896 } 897 898 //---------------------------------------------------------- 899 void Project::add_child (Project* p) 900 { 901 if (p == 0) return; 902 903 int i; 904 905 for (i = 0; i < m_parents.size (); i++) 906 { 907 Project* parent = m_parents[i]; 908 if (parent == 0) continue; 909 910 if (parent->get_name () == p->get_name ()) 911 { 912 // Already registered as a parent (no cycle permitted!!) 913 return; 914 } 915 } 916 917 for (i = 0; i < m_children.size (); i++) 918 { 919 Project* child = m_children[i]; 920 if (child == 0) continue; 921 922 if (child->get_name () == p->get_name ()) 923 { 924 // Already registered 925 return; 926 } 927 } 928 929 m_children.push_back (p); 735 930 } 736 931 … … 876 1071 IProjectFactory& factory = ProjectFactory::instance (); 877 1072 878 factory.create_project (p, "ProjectPath" );1073 factory.create_project (p, "ProjectPath", this); 879 1074 880 1075 break; … … 908 1103 909 1104 //---------------------------------------------------------- 910 void Project::show () const 911 { 1105 void Project::show () 1106 { 1107 static int level = 0; 1108 912 1109 bool is_current = false; 913 1110 … … 922 1119 } 923 1120 1121 for (int tab = 0; tab < level; tab++) cout << " "; 924 1122 cout << m_name << " " << m_release << " (in " << m_cmtpath << ")"; 925 1123 926 1124 if (is_current) cout << " (current)"; 927 1125 1126 int i; 1127 1128 for (i = 0; i < m_parents.size (); i++) 1129 { 1130 Project* p = m_parents[i]; 1131 if (p == 0) continue; 1132 cout << " P=" << p->get_name (); 1133 } 1134 1135 for (i = 0; i < m_children.size (); i++) 1136 { 1137 Project* p = m_children[i]; 1138 if (p == 0) continue; 1139 cout << " C=" << p->get_name (); 1140 } 1141 928 1142 cout << endl; 1143 1144 if (m_visited) return; 1145 1146 m_visited = true; 1147 1148 for (i = 0; i < m_children.size (); i++) 1149 { 1150 Project* p = m_children[i]; 1151 if (p == 0) continue; 1152 level++; 1153 p->show (); 1154 level--; 1155 } 929 1156 } 930 1157 … … 940 1167 int result = 0; 941 1168 1169 /* 942 1170 if (m_reference != 0) result = m_reference->get_build_strategy (); 943 1171 else if (m_predecessor != 0) result = m_predecessor->get_build_strategy (); 944 1172 else result = Cmt::get_current_build_strategy (); 1173 */ 1174 1175 result = Cmt::get_current_build_strategy (); 945 1176 946 1177 if (m_build_strategy_mask != 0) … … 958 1189 int result = 0; 959 1190 1191 /* 960 1192 if (m_reference != 0) result = m_reference->get_setup_strategy (); 961 1193 else if (m_predecessor != 0) result = m_predecessor->get_setup_strategy (); 962 1194 else result = Cmt::get_current_setup_strategy (); 1195 */ 1196 1197 result = Cmt::get_current_setup_strategy (); 963 1198 964 1199 if (m_setup_strategy_mask != 0) … … 1017 1252 } 1018 1253 1254 1255 /* 1019 1256 static ProjectVector& Projects = projects (); 1020 1257 … … 1032 1269 } 1033 1270 } 1271 */ 1034 1272 1035 1273 } … … 1089 1327 } 1090 1328 1329 /* 1091 1330 static ProjectVector& Projects = projects (); 1092 1331 … … 1104 1343 } 1105 1344 } 1106 } 1107 1345 */ 1346 } 1347 -
CMT/v1r19/source/cmt_project.h
r8 r9 21 21 public: 22 22 void reset (); 23 void create_project (const cmt_string& path, 24 const cmt_string& path_source); 23 Project* create_project (const cmt_string& path, 24 const cmt_string& path_source, 25 Project* parent); 25 26 26 27 private: … … 36 37 }; 37 38 39 class IProjectVisitor 40 { 41 public: 42 virtual void pre (Project* p) = 0; 43 virtual void in (Project* p) = 0; 44 virtual void post (Project* p) = 0; 45 }; 46 38 47 class Project 39 48 { … … 41 50 42 51 typedef cmt_vector<Project> ProjectVector; 52 typedef cmt_vector<Project*> ProjectPtrVector; 43 53 44 54 static void create (const cmt_string& name); … … 65 75 static cmt_string find_in_cmt_paths (const cmt_string& path); 66 76 67 static void set_cmtpaths (cmt_string& buffer); 77 static void fill_cmtpaths (cmt_string& buffer); 78 79 static void start_visit (IProjectVisitor& visitor); 68 80 69 81 public: … … 76 88 const cmt_string& get_cmtpath_pwd () const; 77 89 const cmt_string& get_cmtpath_source () const; 90 int get_children_size () const; 91 Project* get_child (int index) const; 92 bool visited () const; 93 78 94 void set_name (const cmt_string& name); 79 95 void set_release (const cmt_string& release); … … 81 97 void set_cmtpath_pwd (const cmt_string& path); 82 98 void set_cmtpath_source (const cmt_string& source); 83 void set_predecessor (Project* predecessor);84 void set_reference (Project* reference);85 99 void clear (); 86 100 void configure (); 101 void add_parent (Project* p); 102 void add_child (Project* p); 87 103 88 104 void use_action (const cmt_string& name, const cmt_string& release); … … 92 108 bool operator != (const cmt_string& name) const; 93 109 94 void show () const;110 void show (); 95 111 void show_strategies () const; 96 112 int get_build_strategy () const; … … 99 115 void set_setup_strategy (int mask, int strategy); 100 116 117 void visit (IProjectVisitor& visitor); 118 101 119 private: 120 121 void fill_cmtpath (cmt_string& buffer); 122 102 123 cmt_string m_name; 103 124 cmt_string m_release; 104 125 105 Project* m_reference; 106 Project* m_predecessor; 126 ProjectPtrVector m_parents; 127 ProjectPtrVector m_children; 128 129 bool m_visited; 107 130 108 131 cmt_string m_cmtpath; -
CMT/v1r19/source/cmt_system.cxx
r2 r9 1229 1229 1230 1230 //---------------------------------------------------------- 1231 void CmtSystem::add_cmt_path (const cmt_string& path, 1232 const cmt_string& path_source, 1233 IProjectFactory& factory) 1234 { 1235 cmt_string npath = path; 1236 1237 if (npath == "") return; 1231 // 1232 // This singleton interacts with the ProjectFactory to consistently create 1233 // the project graph. 1234 // 1235 // In particular a single-depth stack of the top project is maintained. 1236 // 1237 //---------------------------------------------------------- 1238 class CMTPathManager 1239 { 1240 public: 1241 static CMTPathManager& instance (); 1242 static void reset (); 1243 static void add_cmt_path (const cmt_string& path, 1244 const cmt_string& path_source, 1245 IProjectFactory& factory); 1246 1247 private: 1248 CMTPathManager () : m_project (0) 1249 { 1250 } 1251 1252 void do_reset () 1253 { 1254 m_project = 0; 1255 } 1256 1257 void do_add_cmt_path (const cmt_string& path, 1258 const cmt_string& path_source, 1259 IProjectFactory& factory) 1260 { 1261 cmt_string npath = path; 1262 1263 if (npath == "") return; 1238 1264 1239 1265 #ifdef WIN32 1240 if (npath.size () == 2) 1241 { 1242 if (npath[1] == ':') 1243 { 1244 npath += file_separator (); 1245 } 1246 } 1247 #endif 1248 1249 npath.replace_all ("\\", file_separator ()); 1250 npath.replace_all ("/", file_separator ()); 1251 1252 if (!absolute_path (npath)) 1253 { 1254 cmt_string h = pwd (); 1255 h += file_separator (); 1256 h += npath; 1257 npath = h; 1258 } 1259 1260 compress_path (npath); 1261 1262 //cerr << "adding npath=" << npath << endl; 1263 1264 while (npath[npath.size ()-1] == file_separator ()) 1265 { 1266 npath.erase (npath.size ()-1); 1267 } 1268 1269 //cerr << "adding npath=[" << npath << "]" << endl; 1270 1271 if (npath != "") 1272 { 1273 if (!test_directory (npath)) 1274 { 1275 CmtError::set (CmtError::path_not_found, npath); 1276 return; 1277 } 1278 1279 factory.create_project (npath, path_source); 1280 } 1281 } 1266 if (npath.size () == 2) 1267 { 1268 if (npath[1] == ':') 1269 { 1270 npath += CmtSystem::file_separator (); 1271 } 1272 } 1273 #endif 1274 1275 npath.replace_all ("\\", CmtSystem::file_separator ()); 1276 npath.replace_all ("/", CmtSystem::file_separator ()); 1277 1278 if (!CmtSystem::absolute_path (npath)) 1279 { 1280 cmt_string h = CmtSystem::pwd (); 1281 h += CmtSystem::file_separator (); 1282 h += npath; 1283 npath = h; 1284 } 1285 1286 CmtSystem::compress_path (npath); 1287 1288 //cerr << "adding npath=" << npath << endl; 1289 1290 while (npath[npath.size ()-1] == CmtSystem::file_separator ()) 1291 { 1292 npath.erase (npath.size ()-1); 1293 } 1294 1295 //cerr << "adding npath=[" << npath << "]" << endl; 1296 1297 if (npath != "") 1298 { 1299 if (!CmtSystem::test_directory (npath)) 1300 { 1301 CmtError::set (CmtError::path_not_found, npath); 1302 return; 1303 } 1304 1305 m_project = factory.create_project (npath, path_source, m_project); 1306 } 1307 } 1308 1309 Project* m_project; 1310 }; 1311 1312 CMTPathManager& CMTPathManager::instance () 1313 { 1314 static CMTPathManager me; 1315 1316 return (me); 1317 } 1318 1319 void CMTPathManager::reset () 1320 { 1321 static CMTPathManager& me = instance (); 1322 me.do_reset (); 1323 } 1324 1325 void CMTPathManager::add_cmt_path (const cmt_string& path, 1326 const cmt_string& path_source, 1327 IProjectFactory& factory) 1328 { 1329 static CMTPathManager& me = instance (); 1330 me.do_add_cmt_path (path, path_source, factory); 1331 } 1332 1333 1282 1334 1283 1335 //---------------------------------------------------------- … … 1295 1347 const cmt_string& path = path_vector[i]; 1296 1348 1297 C mtSystem::add_cmt_path (path, context, factory);1298 } 1299 } 1300 1301 //---------------------------------------------------------- 1302 static void add_cmt_paths (const cmt_string& file_name, IProjectFactory& factory)1349 CMTPathManager::add_cmt_path (path, context, factory); 1350 } 1351 } 1352 1353 //---------------------------------------------------------- 1354 static void add_cmt_paths_from_file (const cmt_string& file_name, IProjectFactory& factory) 1303 1355 { 1304 1356 if (!CmtSystem::test_file (file_name)) return; … … 1324 1376 1325 1377 //---------------------------------------------------------- 1326 void CmtSystem::get_cmt_paths (IProjectFactory& factory, const cmt_string& init_text) 1327 { 1378 // 1379 // With this function we analyse all possible ways of 1380 // externally entering CMTPATH items 1381 // + from the environment variable 1382 // + from .cmtrc files 1383 // + from registry on Windows 1384 // + from EV settings for CMTUSERCONTEXT and CMTHOME 1385 // 1386 // Then projects are created from these settings. 1387 // 1388 // (The other way to enter project graph is through project files) 1389 //---------------------------------------------------------- 1390 void CmtSystem::get_cmt_paths (IProjectFactory& factory, 1391 const cmt_string& init_text, 1392 const cmt_string& cmt_user_context, 1393 const cmt_string& cmt_home) 1394 { 1395 CMTPathManager::reset (); 1396 1328 1397 if (init_text != "") 1329 1398 { … … 1355 1424 { 1356 1425 const cmt_string path = temp; 1357 add_cmt_path (path, "HKEY_CURRENT_USER", factory);1426 CMTPathManager::add_cmt_path (path, "HKEY_CURRENT_USER", factory); 1358 1427 } 1359 1428 … … 1388 1457 { 1389 1458 const cmt_string path = temp; 1390 add_cmt_path (path, "HKEY_LOCAL_MACHINE", factory);1459 CMTPathManager::add_cmt_path (path, "HKEY_LOCAL_MACHINE", factory); 1391 1460 } 1392 1461 else … … 1421 1490 const cmt_string& path = path_vector[i]; 1422 1491 1423 add_cmt_path (path, "${CMTPATH}", factory);1424 } 1425 } 1426 1427 add_cmt_paths (".cmtrc", factory);1492 CMTPathManager::add_cmt_path (path, "${CMTPATH}", factory); 1493 } 1494 } 1495 1496 add_cmt_paths_from_file (".cmtrc", factory); 1428 1497 1429 1498 if (get_home_directory (rc_name)) … … 1431 1500 rc_name += file_separator (); 1432 1501 rc_name += ".cmtrc"; 1433 add_cmt_paths (rc_name, factory);1502 add_cmt_paths_from_file (rc_name, factory); 1434 1503 } 1435 1504 … … 1446 1515 rc_name += ".cmtrc"; 1447 1516 1448 add_cmt_paths (rc_name, factory); 1449 1450 //add_cmt_path (get_cmt_root (), "default path", factory); 1517 add_cmt_paths_from_file (rc_name, factory); 1518 1519 // Suppress the definition of a CMTPATH entry for CMT itself 1520 //CMTPathManager::add_cmt_path (get_cmt_root (), "default path", factory); 1521 1522 CMTPathManager::add_cmt_path (cmt_user_context, "CMTUSERCONTEXT", factory); 1523 CMTPathManager::add_cmt_path (cmt_home, "CMTHOME", factory); 1451 1524 } 1452 1525 -
CMT/v1r19/source/cmt_system.h
r2 r9 13 13 #include "cmt_regexp.h" 14 14 15 class Project; 16 15 17 class IProjectFactory 16 18 { 17 19 public: 18 20 virtual void reset () = 0; 19 virtual void create_project (const cmt_string& path, 20 const cmt_string& path_source) = 0; 21 virtual Project* create_project (const cmt_string& path, 22 const cmt_string& path_source, 23 Project* parent) = 0; 21 24 }; 22 25 … … 107 110 static cmt_string getenv (const cmt_string& name); 108 111 static bool putenv (const cmt_string& name_value); 109 static void add_cmt_path (const cmt_string& path,110 const cmt_string& path_source,111 IProjectFactory& factory);112 112 static void get_cmt_paths (IProjectFactory& factory, 113 const cmt_string& init_text = ""); 113 const cmt_string& init_text, 114 const cmt_string& cmt_user_context, 115 const cmt_string& cmt_home); 114 116 static int execute (const cmt_string& command); 115 117 static int execute (const cmt_string& command, cmt_string& output);
Note: See TracChangeset
for help on using the changeset viewer.