Fawkes API  Fawkes Development Version
EclipsePath Class Reference

Class to determine the location of ECLiPSe-clp programs. More...

Public Member Functions

void add_path (std::string path)
 Add a new path. More...
 
void add_path_check (std::string path)
 Add a new path and apply regexes to all paths. More...
 
std::string locate_file (std::string filename)
 Locate a file by filename. More...
 
void add_regex (boost::regex re, std::string str)
 Add a regex. More...
 
void apply_regexes ()
 Apply the regexes to all paths. More...
 
void print_all_paths ()
 Debug method to print all path to the command line. More...
 

Static Public Member Functions

static void create_initial_object ()
 Create the initial EclipsePath object. More...
 
static EclipsePathinstance ()
 Get the EclipsePath instance. More...
 

Public Attributes

std::vector< std::string > paths
 all paths known More...
 
std::map< boost::regex, std::string > regexes
 regexes and strings they should be replaced with More...
 

Detailed Description

Class to determine the location of ECLiPSe-clp programs.

Given a filename the complete path to that file will be specified. Paths can contain variables, which will be transformed to the string if matched by a regex.

Author
Gesche Gierse
Tim Niemueller

Definition at line 31 of file eclipse_path.h.

Member Function Documentation

◆ add_path()

void EclipsePath::add_path ( std::string  path)

Add a new path.

Parameters
pathThe path to be added.

Definition at line 79 of file eclipse_path.cpp.

Referenced by EclipseAgentThread::init().

◆ add_path_check()

void EclipsePath::add_path_check ( std::string  path)

Add a new path and apply regexes to all paths.

Parameters
pathThe path to be added.

Definition at line 89 of file eclipse_path.cpp.

◆ add_regex()

void EclipsePath::add_regex ( boost::regex  re,
std::string  str 
)

Add a regex.

To apply the regex to all paths use apply_regexes().

Parameters
rethe regex to be matched
strthe string by which each instanstance of the regex will be replaced

Definition at line 163 of file eclipse_path.cpp.

References instance(), and locate_file().

Referenced by EclipseAgentThread::init().

◆ apply_regexes()

void EclipsePath::apply_regexes ( )

Apply the regexes to all paths.

Definition at line 132 of file eclipse_path.cpp.

Referenced by EclipseAgentThread::init().

◆ create_initial_object()

void EclipsePath::create_initial_object ( )
static

Create the initial EclipsePath object.

Already supplies regexes for BASEDIR, CONFDIR and FAWKES_BASEDIR

Definition at line 54 of file eclipse_path.cpp.

Referenced by EclipseAgentThread::init().

◆ instance()

EclipsePath * EclipsePath::instance ( )
static

Get the EclipsePath instance.

Returns
the instance

Definition at line 67 of file eclipse_path.cpp.

Referenced by add_regex(), and EclipseAgentThread::init().

◆ locate_file()

std::string EclipsePath::locate_file ( std::string  filename)

Locate a file by filename.

Parameters
filenamethe searched filename
Returns
path to the file

Definition at line 100 of file eclipse_path.cpp.

Referenced by add_regex(), and EclipseAgentThread::init().

◆ print_all_paths()

void EclipsePath::print_all_paths ( )

Debug method to print all path to the command line.

Definition at line 150 of file eclipse_path.cpp.

Referenced by EclipseAgentThread::init().

Member Data Documentation

◆ paths

std::vector<std::string> EclipsePath::paths

all paths known

Definition at line 49 of file eclipse_path.h.

◆ regexes

std::map<boost::regex, std::string> EclipsePath::regexes

regexes and strings they should be replaced with

Definition at line 50 of file eclipse_path.h.


The documentation for this class was generated from the following files: