Static Public Member Functions | |
CMTPathManager & | instance () |
void | reset () |
void | add_cmt_path (const cmt_string &path, const cmt_string &path_source, IProjectFactory &factory) |
Private Member Functions | |
CMTPathManager () | |
void | do_reset () |
void | do_add_cmt_path (const cmt_string &path, const cmt_string &path_source, IProjectFactory &factory) |
Private Attributes | |
Project * | m_project |
|
Definition at line 1250 of file cmt_system.cxx. References m_project.
01250 : m_project (0) 01251 { 01252 } |
|
Definition at line 1335 of file cmt_system.cxx. References do_add_cmt_path(), and instance(). Referenced by add_cmt_paths_from_text(), and CmtSystem::get_cmt_paths().
01338 { 01339 static CMTPathManager& me = instance (); 01340 me.do_add_cmt_path (path, path_source, factory); 01341 } |
|
Definition at line 1259 of file cmt_system.cxx. References CmtSystem::absolute_path(), CmtSystem::compress_path(), IProjectFactory::create_project(), cmt_string::erase(), CmtSystem::file_separator(), m_project, CmtSystem::pwd(), cmt_string::replace_all(), CmtError::set(), cmt_string::size(), and CmtSystem::test_directory(). Referenced by add_cmt_path().
01262 { 01263 cmt_string npath = path; 01264 01265 if (npath == "") return; 01266 01267 #ifdef WIN32 01268 if (npath.size () == 2) 01269 { 01270 if (npath[1] == ':') 01271 { 01272 npath += CmtSystem::file_separator (); 01273 } 01274 } 01275 #endif 01276 01277 npath.replace_all ("\\", CmtSystem::file_separator ()); 01278 npath.replace_all ("/", CmtSystem::file_separator ()); 01279 01280 if (!CmtSystem::absolute_path (npath)) 01281 { 01282 cmt_string h = CmtSystem::pwd (); 01283 h += CmtSystem::file_separator (); 01284 h += npath; 01285 npath = h; 01286 } 01287 01288 CmtSystem::compress_path (npath); 01289 01290 //cerr << "adding npath=" << npath << endl; 01291 01292 while (npath[npath.size ()-1] == CmtSystem::file_separator ()) 01293 { 01294 npath.erase (npath.size ()-1); 01295 } 01296 01297 //cerr << "adding npath=[" << npath << "]" << endl; 01298 01299 if (npath != "") 01300 { 01301 if (!CmtSystem::test_directory (npath)) 01302 { 01303 CmtError::set (CmtError::path_not_found, npath); 01304 return; 01305 } 01306 01307 cmt_string project_name; 01308 01309 if ((path_source == "CMTUSERCONTEXT") || 01310 (path_source == "CMTHOME")) 01311 { 01312 project_name = path_source; 01313 } 01314 01315 m_project = factory.create_project (project_name, npath, path_source, m_project); 01316 } 01317 } |
|
Definition at line 1254 of file cmt_system.cxx. References m_project. Referenced by reset().
01255 { 01256 m_project = 0; 01257 } |
|
Definition at line 1322 of file cmt_system.cxx. Referenced by add_cmt_path(), and reset().
01323 { 01324 static CMTPathManager me; 01325 01326 return (me); 01327 } |
|
Definition at line 1329 of file cmt_system.cxx. References do_reset(), and instance(). Referenced by CmtSystem::get_cmt_paths().
01330 { 01331 static CMTPathManager& me = instance (); 01332 me.do_reset (); 01333 } |
|
Definition at line 1319 of file cmt_system.cxx. Referenced by CMTPathManager(), do_add_cmt_path(), and do_reset(). |