39 return make_shared<LocationsCSVReader>(OpenFile(path));
49 return make_shared<CommutesCSVReader>(OpenFile(path));
59 return make_shared<HouseholdCSVReader>(OpenFile(path));
64 if (!filesys::exists(path)) {
65 throw runtime_error(
"File not found: " + path.string());
68 if (path.extension().string() ==
".csv") {
69 return make_unique<ifstream>(path.string());
71 throw runtime_error(
"Unsupported file extension: " + path.extension().string());
static filesys::path GetDataDir()
/// Return data dir (only relevant when use_install_dirs mode is active)
Utilities for the project.
static std::shared_ptr< CommutesReader > CreateCommutesReader(const std::string &filename)
Create a CommutesReader based on the filename relative to the data directory.
static std::unique_ptr< std::istream > OpenFile(const filesys::path &path)
Create an istream based on the filesystem path.
static std::shared_ptr< LocationsReader > CreateLocationsReader(const std::string &filename)
Create a Reader based on the filename relative to the data directory.
Namespace for the geographic and demograhic classes.
static std::shared_ptr< HouseholdReader > CreateHouseholdReader(const std::string &filename)
Create a HouseholdReader based on the filename relative to the data directory.
Interface for install directory queries.