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

cmt_system.cxx File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <dirent.h>
#include "cmt_system.h"
#include "cmt_error.h"

Include dependency graph for cmt_system.cxx:

Include dependency graph

Go to the source code of this file.

Classes

class  CMTPathManager

Functions

void add_cmt_paths_from_text (const cmt_string &text, const cmt_string &context, IProjectFactory &factory)
void add_cmt_paths_from_file (const cmt_string &file_name, IProjectFactory &factory)


Function Documentation

void add_cmt_paths_from_file const cmt_string file_name,
IProjectFactory factory
[static]
 

Definition at line 1364 of file cmt_system.cxx.

References add_cmt_paths_from_text(), cmt_string::erase(), cmt_string::find(), cmt_string::read(), and CmtSystem::test_file().

Referenced by CmtSystem::get_cmt_paths().

01365 {
01366   if (!CmtSystem::test_file (file_name)) return;
01367 
01368   static cmt_string text;
01369 
01370   text.read (file_name);
01371 
01372   int pos = text.find ("CMTPATH");
01373   if (pos == cmt_string::npos) return;
01374   pos += strlen ("CMTPATH");
01375   pos = text.find (pos, "=");
01376   if (pos == cmt_string::npos) return;
01377   pos++;
01378 
01379   text.erase (0, pos);
01380 
01381   int nl = text.find (pos, "\n");
01382   if (nl != cmt_string::npos) text.erase (nl);
01383 
01384   add_cmt_paths_from_text (text, file_name, factory);
01385 }

void add_cmt_paths_from_text const cmt_string text,
const cmt_string context,
IProjectFactory factory
[static]
 

Definition at line 1346 of file cmt_system.cxx.

References CMTPathManager::add_cmt_path(), CmtSystem::cmt_string_vector, cmt_vector< T >::size(), and CmtSystem::split().

Referenced by add_cmt_paths_from_file(), and CmtSystem::get_cmt_paths().

01349 {
01350   static CmtSystem::cmt_string_vector path_vector;
01351   int i;
01352 
01353   CmtSystem::split (text, CmtSystem::path_separator (), path_vector);
01354 
01355   for (i = 0; i < path_vector.size (); i++)
01356     {
01357       const cmt_string& path = path_vector[i];
01358 
01359       CMTPathManager::add_cmt_path (path, context, factory);
01360     }
01361 }


Generated on Mon May 2 10:25:22 2005 for CMT by doxygen 1.3.5