FileFinder Class Reference

#include <FileFinder.hpp>

Collaboration diagram for FileFinder:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
rPath the path to the file to find
relativeTo how to interpret this path

Definition at line 43 of file FileFinder.cpp.

References SetAbsolutePath().


Member Function Documentation

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.

Parameters:
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.

Parameters:
rPath the path to the file to find

Definition at line 51 of file FileFinder.cpp.

References OutputFileHandler::GetChasteTestOutputDirectory(), and mAbsPath.

Referenced by FileFinder().


Member Data Documentation

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().


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2