45 [](
const string& filename,
const string& path) -> shared_ptr<IFile>
47 auto endswith = [](
const string& s1,
const string& s2) {
48 if (s2.length() > s1.length()) {
51 std::string s1lower = s1;
52 std::transform(s1lower.begin(), s1lower.end(), s1lower.begin(), ::tolower);
53 std::string s2lower = s2;
54 std::transform(s2lower.begin(), s2lower.end(), s2lower.begin(), ::tolower);
56 return s1lower.compare(s1lower.length()-s2lower.length(), string::npos, s2lower) == 0;
59 if (endswith(filename,
".h5")) {
60 return make_shared<StartupFileHdf5>(path);
61 }
else if (endswith(filename,
".xml")) {
62 return make_shared<StartupFileXml>(path);
63 }
else if (endswith(filename,
".xml.gz")) {
64 return make_shared<StartupFileXmlGz>(path);
Interface for Hdf5 tissue file format.
Namespace for miscellaneous utilities.
Namespace for SimPT shell package.
StartupFileBase(const std::string &path)
Constructor.
Interface for StartupFileXml.
std::function< std::shared_ptr< IFile >(const std::string &, const std::string &)> ConstructorType
First argument: filename.
virtual const std::string & GetPath() const
Interface for StartupFileXmlGz.