1 // dirsearch.h -- directory searching for gold -*- C++ -*-
3 #ifndef GOLD_DIRSEARCH_H
4 #define GOLD_DIRSEARCH_H
14 class General_options;
16 // A simple interface to manage directories to be searched for
24 // Add a directory to the search path.
26 add(Workqueue*, const char*);
28 // Add a list of directories to the search path.
30 add(Workqueue*, const General_options::Dir_list&);
32 // Search for a file, giving one or two names to search for (the
33 // second one may be empty). Return a full path name for the file,
34 // or the empty string if it could not be found. This may only be
35 // called if the token is not blocked.
37 find(const std::string&, const std::string& n2 = std::string()) const;
39 // Return a reference to the blocker token which controls access.
42 { return this->token_; }
45 // We can not copy this class.
46 Dirsearch(const Dirsearch&);
47 Dirsearch& operator=(const Dirsearch&);
49 // Directories to search.
50 std::list<const char*> directories_;
51 // Blocker token to control access from tasks.
55 } // End namespace gold.
57 #endif // !defined(GOLD_DIRSEARCH_H)