Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
CompressionMode.cpp
Go to the documentation of this file.
2
5
6namespace storm::io {
7
9 using enum CompressionMode;
10 if (input == "default") {
11 return Default;
12 } else if (input == "none") {
13 return None;
14 } else if (input == "gzip") {
15 return Gzip;
16 } else if (input == "xz") {
17 return Xz;
18 }
19 STORM_LOG_THROW(false, storm::exceptions::InvalidArgumentException, "The compression mode '" << input << "' does not match any known mode.");
20 return Default;
21}
22
23std::string toString(CompressionMode const& input) {
24 using enum CompressionMode;
25 switch (input) {
26 case Default:
27 return "default";
28 case None:
29 return "none";
30 case Gzip:
31 return "gzip";
32 case Xz:
33 return "xz";
34 }
35 STORM_LOG_THROW(false, storm::exceptions::InvalidArgumentException, "Unhandled model export format.");
36 return "";
37}
38
39CompressionMode getCompressionModeFromFileExtension(std::filesystem::path const& filename) {
40 if (filename.extension() == ".gz") {
42 } else if (filename.extension() == ".xz") {
44 }
46}
47
48} // namespace storm::io
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
std::string toString(CompressionMode const &input)
CompressionMode getCompressionModeFromString(std::string const &input)
CompressionMode getCompressionModeFromFileExtension(std::filesystem::path const &filename)