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 <boost/filesystem.hpp>
27#include <boost/regex.hpp>
28#include <string>
29#include <vector>
30
32{
33private:
35
36public:
37 static void create_initial_object();
38 static EclipsePath *instance();
39 void add_path(const std::string &path);
40 void add_path_check(const std::string &path);
41 std::string locate_file(const std::string &filename);
42 void add_regex(boost::regex re, const std::string &str);
43 void apply_regexes();
44 void print_all_paths();
45
46private:
47 static EclipsePath *m_instance;
48
49public: /* members */
50 std::vector<std::string> paths; //!< all paths known
51 std::map<boost::regex, std::string>
52 regexes; /**< regexes and strings they should be replaced with */
53};
54
55extern "C" int p_locate_file(...);
56
57#endif
Class to determine the location of ECLiPSe-clp programs.
Definition: eclipse_path.h:32
void add_path(const std::string &path)
Add a new path.
static EclipsePath * instance()
Get the EclipsePath instance.
std::map< boost::regex, std::string > regexes
regexes and strings they should be replaced with
Definition: eclipse_path.h:52
std::string locate_file(const std::string &filename)
Locate a file by filename.
static void create_initial_object()
Create the initial EclipsePath object.
void add_path_check(const std::string &path)
Add a new path and apply regexes to all paths.
void print_all_paths()
Debug method to print all path to the command line.
void apply_regexes()
Apply the regexes to all paths.
void add_regex(boost::regex re, const std::string &str)
Add a regex.
std::vector< std::string > paths
all paths known
Definition: eclipse_path.h:50