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:

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 1220 of file cmt_system.cxx. Referenced by CmtSystem::get_cmt_paths().
    01224 {
    01225   if (!CmtSystem::test_file (file_name)) return;
    01226
    01227   static cmt_string text;
    01228
    01229   text.read (file_name);
    01230
    01231   int pos = text.find ("CMTPATH");
    01232   if (pos == cmt_string::npos) return;
    01233   pos += strlen ("CMTPATH");
    01234   pos = text.find (pos, "=");
    01235   if (pos == cmt_string::npos) return;
    01236   pos++;
    01237
    01238   text.erase (0, pos);
    01239
    01240   int nl = text.find (pos, "\n");
    01241   if (nl != cmt_string::npos) text.erase (nl);
    01242
    01243   add_cmt_paths_from_text (text, file_name, paths, path_pwds, path_sources);
    01244 }

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 1200 of file cmt_system.cxx. Referenced by add_cmt_paths(), and CmtSystem::get_cmt_paths().
    01205 {
    01206   static CmtSystem::cmt_string_vector path_vector;
    01207   int i;
    01208
    01209   CmtSystem::split (text, CmtSystem::path_separator (), path_vector);
    01210
    01211   for (i = 0; i < path_vector.size (); i++)
    01212     {
    01213       const cmt_string& path = path_vector[i];
    01214
    01215       CmtSystem::add_cmt_path (path, context, paths, path_pwds, path_sources);
    01216     }
    01217 }