Browse Source

implementing check for filename extension

tempestpy_adaptions
gereon 12 years ago
parent
commit
a6dcb236e2
  1. 9
      src/parser/AutoTransitionParser.cpp

9
src/parser/AutoTransitionParser.cpp

@ -61,6 +61,15 @@ AutoTransitionParser::AutoTransitionParser(const std::string& filename)
TransitionType AutoTransitionParser::analyzeFilename(const std::string& filename) { TransitionType AutoTransitionParser::analyzeFilename(const std::string& filename) {
TransitionType type = Unknown; TransitionType type = Unknown;
// find file extension
std::string::size_type extpos = filename.rfind(".");
if (extpos == std::string::npos) return Unknown;
else extpos++;
// check file extension
if (filename.substr(extpos) == "dtmc") type = DTMC;
else if (filename.substr(extpos) == "ndtmc") type = NDTMC;
return type; return type;
} }

Loading…
Cancel
Save