| 156 | } |
| 157 | |
| 158 | std::string ResolvePreferencesXMLFromCLIArg(const QString& arg, const char* kind) |
| 159 | { |
| 160 | if (arg.startsWith('@')) |
| 161 | { |
| 162 | const auto filePath = arg.mid(1).toStdString(); |
| 163 | if (filePath.empty()) |
| 164 | mitkThrow() << "Cannot open preferences " << kind << " file. \"@\" indicates file reference, but has no file path following."; |
| 165 | |
| 166 | std::ifstream file(filePath); |
| 167 | |
| 168 | if (!file.is_open()) |
| 169 | mitkThrow() << "Cannot open preferences " << kind << " file: \"" << filePath << "\"."; |
| 170 | |
| 171 | std::ostringstream buffer; |
| 172 | buffer << file.rdbuf(); |
| 173 | return buffer.str(); |
| 174 | } |
| 175 | |
| 176 | return arg.toStdString(); |
| 177 | } |
| 178 | |
| 179 | void ApplyPreferencesOverridesFromCLI(const QStringList& overrides, mitk::IPreferences* rootPrefs) |
| 180 | { |
no test coverage detected