16 #ifndef SURGSIM_FRAMEWORK_APPLICATIONDATA_H
17 #define SURGSIM_FRAMEWORK_APPLICATIONDATA_H
22 #if !defined(SURGSIM_PARSED_BY_DOXYGEN) // do not generate documentation for Boost stuff!
30 #endif // defined(SURGSIM_PARSED_BY_DOXYGEN)
59 std::vector<std::string>
getPaths()
const;
68 std::string
findFile(
const std::string& fileName)
const;
76 bool tryFindFile(
const std::string& fileName, std::string* target)
const;
88 bool addPath(
const std::string& pathName);
95 bool setPaths(
const std::vector<std::string>& paths);
97 std::vector<boost::filesystem::path>
m_paths;
103 #endif // SURGSIM_FRAMEWORK_APPLICATIONDATA_H
Definition: DriveElementFromInputBehavior.cpp:27
std::vector< boost::filesystem::path > m_paths
Definition: ApplicationData.h:97
Enable searching for files in a given list of paths, give access to the current directory and wrap bo...
Definition: ApplicationData.h:39
~ApplicationData()
Definition: ApplicationData.cpp:56
bool tryFindFile(const std::string &fileName, std::string *target) const
Searches for the first occurrence of fileName amongst the given paths, see findFile() for details...
Definition: ApplicationData.cpp:84
std::vector< std::string > getPaths() const
Gets the search paths.
Definition: ApplicationData.cpp:140
std::string findFile(const std::string &fileName) const
Searches for the first occurrence of fileName amongst the given paths, the search is shallow...
Definition: ApplicationData.cpp:60
bool setPaths(const std::vector< std::string > &paths)
Sets the list of search paths to be used for finding the location of files.
Definition: ApplicationData.cpp:97
bool isValidFilename(const std::string &fileName) const
Checks if the filename is acceptable.
Definition: ApplicationData.cpp:150
bool addPath(const std::string &pathName)
Adds a single path to the list of search paths.
Definition: ApplicationData.cpp:108
ApplicationData(const std::vector< std::string > &paths)
Constructor, class is immutable, pass a list of paths to be used for searching duplicate paths will b...
Definition: ApplicationData.cpp:31