Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ModelExportFormat.cpp
Go to the documentation of this file.
1#include "ModelExportFormat.h"
2
5
6namespace storm {
7namespace io {
8
10 if (input == "dot") {
12 } else if (input == "drdd") {
14 } else if (input == "drn") {
16 } else if (input == "json") {
18 }
19 STORM_LOG_THROW(false, storm::exceptions::InvalidArgumentException, "The model export format '" << input << "' does not match any known format.");
20}
21
22std::string toString(ModelExportFormat const& input) {
23 switch (input) {
25 return "dot";
27 return "drdd";
29 return "drn";
31 return "json";
32 }
33 STORM_LOG_THROW(false, storm::exceptions::InvalidArgumentException, "Unhandled model export format.");
34}
35
37 auto pos = filename.find_last_of('.');
38 STORM_LOG_THROW(pos != std::string::npos, storm::exceptions::InvalidArgumentException,
39 "Couldn't detect a file extension from input filename '" << filename << "'.");
40 ++pos;
41 return getModelExportFormatFromString(filename.substr(pos));
42}
43
44} // namespace io
45} // namespace storm
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
std::string toString(ModelExportFormat const &input)
ModelExportFormat getModelExportFormatFromString(std::string const &input)
ModelExportFormat getModelExportFormatFromFileExtension(std::string const &filename)
LabParser.cpp.
Definition cli.cpp:18