| 55 | |
| 56 | |
| 57 | bool SmartctlVersionParser::check_format_supported(SmartctlOutputFormat format, const std::string& version_only) |
| 58 | { |
| 59 | if (auto numeric_version = get_numeric_version(version_only); numeric_version.has_value()) { |
| 60 | switch(format) { |
| 61 | case SmartctlOutputFormat::Text: |
| 62 | return numeric_version.value() >= minimum_req_text_version; |
| 63 | case SmartctlOutputFormat::Json: |
| 64 | return numeric_version.value() >= minimum_req_json_version; |
| 65 | } |
| 66 | } |
| 67 | return false; |
| 68 | } |
| 69 | |
| 70 | |
| 71 |