Main Page   Class Hierarchy   Compound List   File List   Compound 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.

Functions

void add_cmt_paths_from_text (const cmt_string& text, const cmt_string& context, CmtSystem::cmt_string_vector& paths, CmtSystem::cmt_string_vector& path_pwds, CmtSystem::cmt_string_vector& path_sources)
void add_cmt_paths (const cmt_string& file_name, CmtSystem::cmt_string_vector& paths, CmtSystem::cmt_string_vector& path_pwds, CmtSystem::cmt_string_vector& path_sources)


Function Documentation

void add_cmt_paths ( const cmt_string & file_name,
CmtSystem::cmt_string_vector & paths,
CmtSystem::cmt_string_vector & path_pwds,
CmtSystem::cmt_string_vector & path_sources ) [static]
 

Definition at line 1202 of file cmt_system.cxx.

Referenced by CmtSystem::get_cmt_paths().

01206 {
01207   if (!CmtSystem::test_file (file_name)) return;
01208 
01209   static cmt_string text;
01210 
01211   text.read (file_name);
01212 
01213   int pos = text.find ("CMTPATH");
01214   if (pos == cmt_string::npos) return;
01215   pos += strlen ("CMTPATH");
01216   pos = text.find (pos, "=");
01217   if (pos == cmt_string::npos) return;
01218   pos++;
01219 
01220   text.erase (0, pos);
01221 
01222   int nl = text.find (pos, "\n");
01223   if (nl != cmt_string::npos) text.erase (nl);
01224 
01225   add_cmt_paths_from_text (text, file_name, paths, path_pwds, path_sources);
01226 }

void add_cmt_paths_from_text ( const cmt_string & text,
const cmt_string & context,
CmtSystem::cmt_string_vector & paths,
CmtSystem::cmt_string_vector & path_pwds,
CmtSystem::cmt_string_vector & path_sources ) [static]
 

Definition at line 1182 of file cmt_system.cxx.

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

01187 {
01188   static CmtSystem::cmt_string_vector path_vector;
01189   int i;
01190 
01191   CmtSystem::split (text, CmtSystem::path_separator (), path_vector);
01192 
01193   for (i = 0; i < path_vector.size (); i++)
01194     {
01195       const cmt_string& path = path_vector[i];
01196 
01197       CmtSystem::add_cmt_path (path, context, paths, path_pwds, path_sources);
01198     }
01199 }


Generated at Thu May 16 16:27:28 2002 for CMT by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000