17 #ifndef CRL_SEARCH_PATH_H 18 #define CRL_SEARCH_PATH_H 22 #include "hurricane/Commons.h" 23 #include "hurricane/Slot.h" 28 using Hurricane::Record;
29 using Hurricane::_TName;
36 inline Element (
const std::string& path=
"",
const std::string& name=
"" );
37 inline bool empty ()
const;
38 inline const std::string&
getPath ()
const;
39 inline const std::string&
getName ()
const;
40 inline std::string _getTypeName ()
const;
41 std::string _getString ()
const;
42 Record* _getRecord ()
const;
48 static const size_t npos;
53 inline size_t append (
const std::string& path,
const std::string& name=
"" );
54 size_t prepend (
const std::string& path,
const std::string& name=
"");
55 size_t replace (
const std::string& path,
const std::string&,
size_t index );
56 void remove (
size_t index );
57 size_t locate (
const std::string& file
58 , std::ios::openmode mode =std::ios::in
61 void select (
const std::string& );
66 size_t hasLib (
const std::string& name )
const;
67 size_t hasPath (
const std::string& path )
const;
70 static const std::string _selectFailed;
71 std::vector<Element> _paths;
73 std::string _selected;
76 bool _canOpen (
const Element& directory
77 ,
const std::string& file
78 , std::ios::openmode mode
81 inline std::string _getTypeName ()
const;
82 std::string _getString ()
const;
83 Record* _getRecord ()
const;
93 inline std::string SearchPath::_getTypeName ()
const {
return _TName(
"SearchPath"); }
97 return _paths.size()-1;
102 , _name(name.empty()?
SearchPath::extractLibName(path):name)
108 inline std::string SearchPath::Element::_getTypeName ()
const {
return "SearchPath::Element"; }
118 #endif // CRL_SEARCH_PATH_H const std::string & getSelected() const
Definition: SearchPath.h:90
void reset()
Definition: SearchPath.h:88
static std::string extractLibName(const std::string &)
size_t getIndex() const
Definition: SearchPath.h:91
bool hasSelected() const
Definition: SearchPath.h:92
size_t locate(const std::string &file, std::ios::openmode mode=std::ios::in, int first=0, int last=64)
An element of the search path (mapping a directory).
Definition: SearchPath.h:34
size_t getSize() const
Definition: SearchPath.h:89
size_t hasPath(const std::string &path) const
An ordered list of search pathes.
Definition: SearchPath.h:32
size_t prepend(const std::string &path, const std::string &name="")
bool empty() const
Definition: SearchPath.h:105
const std::string & getPath() const
Definition: SearchPath.h:106
const std::string & getName() const
Definition: SearchPath.h:107
The namespace of Coriolis Core.
Definition: Environment.h:24
size_t replace(const std::string &path, const std::string &, size_t index)
Element(const std::string &path="", const std::string &name="")
Definition: SearchPath.h:100
size_t append(const std::string &path, const std::string &name="")
Definition: SearchPath.h:95
const Element & operator[](size_t index) const