Skip to content

Commit

Permalink
Support relative paths for cse_config_parser and ssp_parser (#410)
Browse files Browse the repository at this point in the history
* Make path absolute for cse_config_parser and ssp_parser. Closes #407. Closes #309.

* Run clang-format
  • Loading branch information
eidekrist authored Oct 9, 2019
1 parent f239523 commit 8481ade
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/cpp/cse_config_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,10 @@ std::pair<execution, simulator_map> load_cse_config(
std::optional<time_point> overrideStartTime)
{
simulator_map simulatorMap;
const auto configFile = boost::filesystem::is_regular_file(configPath)
? configPath
: configPath / "OspSystemStructure.xml";
const auto absolutePath = boost::filesystem::absolute(configPath);
const auto configFile = boost::filesystem::is_regular_file(absolutePath)
? absolutePath
: absolutePath / "OspSystemStructure.xml";
const auto baseURI = path_to_file_uri(configFile);

const auto parser = cse_config_parser(configFile);
Expand Down
7 changes: 4 additions & 3 deletions src/cpp/ssp_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,10 @@ std::pair<execution, simulator_map> load_ssp(
std::optional<cse::time_point> overrideStartTime)
{
simulator_map simulatorMap;
const auto configFile = boost::filesystem::is_regular_file(configPath)
? configPath
: configPath / "SystemStructure.ssd";
const auto absolutePath = boost::filesystem::absolute(configPath);
const auto configFile = boost::filesystem::is_regular_file(absolutePath)
? absolutePath
: absolutePath / "SystemStructure.ssd";
const auto baseURI = path_to_file_uri(configFile);
const auto parser = ssp_parser(configFile);

Expand Down

0 comments on commit 8481ade

Please sign in to comment.