HeartFileFinder.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "HeartFileFinder.hpp"
00030 #include "Exception.hpp"
00031
00032
00033 HeartFileFinder::HeartFileFinder(const cp::path_type& rPath)
00034 {
00035 std::string relative_path(rPath);
00036 if (rPath.relative_to() == cp::relative_to_type::this_file)
00037 {
00038 SetPath(rPath, HeartConfig::Instance()->GetParametersFilePath());
00039 }
00040 else
00041 {
00042 RelativeTo::Value relative_to;
00043 switch (rPath.relative_to())
00044 {
00045 case cp::relative_to_type::cwd:
00046 relative_to = RelativeTo::CWD;
00047 break;
00048 case cp::relative_to_type::chaste_test_output:
00049 relative_to = RelativeTo::ChasteTestOutput;
00050 break;
00051 case cp::relative_to_type::chaste_source_root:
00052 relative_to = RelativeTo::ChasteSourceRoot;
00053 break;
00054 case cp::relative_to_type::absolute:
00055 relative_to = RelativeTo::Absolute;
00056 break;
00057 default:
00058 NEVER_REACHED;
00059 break;
00060 }
00061 SetPath(relative_path, relative_to);
00062 }
00063 }