#include <FileFinder.hpp>
Public Member Functions | |
FileFinder (const cp::path_type &rPath) | |
FileFinder (const std::string &rPath, cp::relative_to_type relativeTo) | |
bool | Exists () const |
std::string | GetAbsolutePath () const |
bool | IsNewerThan (const FileFinder &rOtherFile) const |
Private Member Functions | |
void | SetAbsolutePath (const cp::path_type &rPath) |
Private Attributes | |
std::string | mAbsPath |
A helper class for finding files, given paths which can be relative to various locations (e.g. the Chaste source tree root, the current directory, the Chaste test output directory, or an absolute path).
Definition at line 41 of file FileFinder.hpp.
FileFinder::FileFinder | ( | const cp::path_type & | rPath | ) |
Create a file finder for the given path. This type includes both a path name, and an attribute specifying how this should be interpreted. See the XML schema for details.
rPath | the path to the file to find |
Definition at line 38 of file FileFinder.cpp.
References SetAbsolutePath().
FileFinder::FileFinder | ( | const std::string & | rPath, | |
cp::relative_to_type | relativeTo | |||
) |
Alternative constructor, taking the components of a cp::path_type.
rPath | the path to the file to find | |
relativeTo | how to interpret this path |
Definition at line 43 of file FileFinder.cpp.
References SetAbsolutePath().
bool FileFinder::Exists | ( | ) | const |
Test whether our file exists.
Definition at line 80 of file FileFinder.cpp.
References mAbsPath.
Referenced by CellMLToSharedLibraryConverter::Convert(), and IsNewerThan().
std::string FileFinder::GetAbsolutePath | ( | ) | const |
Get the absolute path to this file.
Definition at line 89 of file FileFinder.cpp.
References mAbsPath.
Referenced by CellMLToSharedLibraryConverter::Convert(), DynamicModelLoaderRegistry::GetLoader(), and IsNewerThan().
bool FileFinder::IsNewerThan | ( | const FileFinder & | rOtherFile | ) | const |
Test whether this file is newer than another file. Compares modification times.
rOtherFile | the file to test against. |
Definition at line 94 of file FileFinder.cpp.
References Exists(), and GetAbsolutePath().
Referenced by CellMLToSharedLibraryConverter::Convert().
void FileFinder::SetAbsolutePath | ( | const cp::path_type & | rPath | ) | [private] |
Determine the absolute path to this file. Used by constructors.
rPath | the path to the file to find |
Definition at line 51 of file FileFinder.cpp.
References OutputFileHandler::GetChasteTestOutputDirectory(), and mAbsPath.
Referenced by FileFinder().
std::string FileFinder::mAbsPath [private] |
The absolute path to our file
Definition at line 45 of file FileFinder.hpp.
Referenced by Exists(), GetAbsolutePath(), and SetAbsolutePath().