2 * Implements a singleton that maintains program resources.
3 * The single instance is (re)instantiated on demand like:
4 * Resources *res = Resources::Instance();
6 * 24-05-07,Nigel Brown(EMBL): created.
7 * 3-7-07, Mark Larkin, modified this class for clustalw
10 #ifndef RESOURCESCLUSTALW_H
11 #define RESOURCESCLUSTALW_H
21 enum ClustalWResourcePathType {
28 class ClustalWResources
32 /* return the Resources singleton */
33 static ClustalWResources *Instance();
36 void setPathToExecutable(std::string pathToFiles);
39 std::string getDefaultPath() { return defaultPath; }
40 std::string getInstallPath() { return installPath; }
41 std::string getExecutablePath() { return executablePath; }
42 std::string getHomePath() { return homePath; }
44 std::string findFile(const char *file, const ClustalWResourcePathType where = DefaultPath) const;
45 std::string findFile(const std::string file, const ClustalWResourcePathType where = DefaultPath) const;
46 std::string searchPathsForFile(const std::string fileName) const;
52 /* hide the constructors */
54 ClustalWResources(const ClustalWResources&);
55 ClustalWResources& operator= (const ClustalWResources&);
57 std::string dirname(std::string path);
60 std::string defaultPath;
61 std::string installPath;
62 std::string executablePath;