| 208 | } |
| 209 | |
| 210 | ExitCodes outputTo_(ostream &os, ostream &os_tsv) |
| 211 | { |
| 212 | //------------------------------------------------------------- |
| 213 | // Parameter handling |
| 214 | //------------------------------------------------------------- |
| 215 | |
| 216 | // File names |
| 217 | String in = getStringOption_("in"); |
| 218 | |
| 219 | // File type |
| 220 | FileHandler fh; |
| 221 | FileTypes::Type in_type = FileTypes::nameToType(getStringOption_("in_type")); |
| 222 | |
| 223 | if (in_type == FileTypes::UNKNOWN) |
| 224 | { |
| 225 | in_type = FileHandler::getType(in); |
| 226 | writeDebug_(String("Input file type: ") + FileTypes::typeToName(in_type), 2); |
| 227 | } |
| 228 | |
| 229 | if (in_type == FileTypes::UNKNOWN) |
| 230 | { |
| 231 | writeLogError_("Error: Could not determine input file type!"); |
| 232 | return PARSE_ERROR; |
| 233 | } |
| 234 | |
| 235 | os << '\n' |
| 236 | << "-- General information --" |
| 237 | << '\n' |
| 238 | << '\n' |
| 239 | << "File name: " << in << '\n' |
| 240 | << "File type: " << FileTypes::typeToName(in_type) << '\n'; |
| 241 | |
| 242 | os_tsv << "general: file name" |
| 243 | << '\t' << in << '\n' |
| 244 | << "general: file type" |
| 245 | << '\t' << FileTypes::typeToName(in_type) << '\n'; |
| 246 | |
| 247 | PeakMap exp; |
| 248 | FeatureMap feat; |
| 249 | ConsensusMap cons; |
| 250 | IdData id_data; |
| 251 | |
| 252 | //------------------------------------------------------------- |
| 253 | // Validation |
| 254 | //------------------------------------------------------------- |
| 255 | if (getFlag_("v")) |
| 256 | { |
| 257 | bool valid = true; |
| 258 | os << '\n' |
| 259 | << "Validating " << FileTypes::typeToName(in_type) << " file"; |
| 260 | switch (in_type) |
| 261 | { |
| 262 | case FileTypes::MZDATA: |
| 263 | os << " against XML schema version " << MzDataFile().getVersion() << '\n'; |
| 264 | valid = MzDataFile().isValid(in, os); |
| 265 | break; |
| 266 | |
| 267 | case FileTypes::MZML: |
nothing calls this directly
no test coverage detected