Fawkes API  Fawkes Development Version
eclipse_path.h
1 
2 /***************************************************************************
3  * eclipse_path.h - Eclipse-CLP path externals
4  *
5  * Created: Thu Feb 27 15:21:35 2014
6  * Copyright 2014 Gesche Gierse
7  * 2014 Tim Niemueller
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __PLUGINS_ECLIPSE_CLP_EXTERNALS_ECLIPSE_PATH_H_
24 #define __PLUGINS_ECLIPSE_CLP_EXTERNALS_ECLIPSE_PATH_H_
25 
26 #include <vector>
27 #include <string>
28 #include <boost/filesystem.hpp>
29 #include <boost/regex.hpp>
30 
32 {
33  private:
34  EclipsePath();
35  public:
36  static void create_initial_object();
37  static EclipsePath* instance();
38  void add_path(std::string path);
39  void add_path_check(std::string path);
40  std::string locate_file(std::string filename);
41  void add_regex(boost::regex re, std::string str);
42  void apply_regexes();
43  void print_all_paths();
44 
45  private:
46  static EclipsePath* m_instance;
47 
48  public: /* members */
49  std::vector<std::string> paths; //!< all paths known
50  std::map<boost::regex, std::string> regexes; /**< regexes and strings they should be replaced with */
51 };
52 
53 extern "C" int p_locate_file(...);
54 
55 #endif
void apply_regexes()
Apply the regexes to all paths.
void add_regex(boost::regex re, std::string str)
Add a regex.
static EclipsePath * instance()
Get the EclipsePath instance.
void print_all_paths()
Debug method to print all path to the command line.
Class to determine the location of ECLiPSe-clp programs.
Definition: eclipse_path.h:31
std::map< boost::regex, std::string > regexes
regexes and strings they should be replaced with
Definition: eclipse_path.h:50
std::vector< std::string > paths
all paths known
Definition: eclipse_path.h:49
static void create_initial_object()
Create the initial EclipsePath object.
void add_path_check(std::string path)
Add a new path and apply regexes to all paths.
std::string locate_file(std::string filename)
Locate a file by filename.
void add_path(std::string path)
Add a new path.