| 21 | } |
| 22 | |
| 23 | Filereader* Filereader::getFilereader(const HighsLogOptions& log_options, |
| 24 | const std::string filename) { |
| 25 | Filereader* reader; |
| 26 | std::string extension = getFilenameExt(filename); |
| 27 | if (extension == "gz") { |
| 28 | #ifdef ZLIB_FOUND |
| 29 | extension = getFilenameExt(filename.substr(0, filename.size() - 3)); |
| 30 | #else |
| 31 | highsLogUser(log_options, HighsLogType::kError, |
| 32 | "HiGHS build without zlib support. Cannot read .gz file.\n", |
| 33 | filename.c_str()); |
| 34 | reader = NULL; |
| 35 | #endif |
| 36 | } |
| 37 | std::string lower_case_extension = extension; |
| 38 | tolower(lower_case_extension); |
| 39 | if (lower_case_extension.compare("mps") == 0) { |
| 40 | reader = new FilereaderMps(); |
| 41 | } else if (lower_case_extension.compare("lp") == 0) { |
| 42 | reader = new FilereaderLp(); |
| 43 | } else { |
| 44 | reader = NULL; |
| 45 | } |
| 46 | return reader; |
| 47 | } |
| 48 | |
| 49 | void interpretFilereaderRetcode(const HighsLogOptions& log_options, |
| 50 | const std::string& filename, |
nothing calls this directly
no test coverage detected