Cache a file to disk
| 277 | |
| 278 | /// Cache a file to disk |
| 279 | OpenSwath::SpectrumAccessPtr SwathFile::doCacheFile_(const String& in, const String& tmp, const String& tmp_fname, |
| 280 | const boost::shared_ptr<PeakMap >& experiment_metadata) |
| 281 | { |
| 282 | String cached_file = tmp + tmp_fname + ".cached"; |
| 283 | String meta_file = tmp + tmp_fname; |
| 284 | |
| 285 | // Create new consumer, transform infile, write out metadata |
| 286 | { |
| 287 | MSDataCachedConsumer cachedConsumer(cached_file, true); |
| 288 | MzMLFile().transform(in, &cachedConsumer, *experiment_metadata.get()); |
| 289 | Internal::CachedMzMLHandler().writeMetadata(*experiment_metadata.get(), meta_file, true); |
| 290 | } // ensure that filestream gets closed |
| 291 | |
| 292 | boost::shared_ptr<PeakMap > exp(new PeakMap); |
| 293 | MzMLFile().load(meta_file, *exp.get()); |
| 294 | return SimpleOpenMSSpectraFactory::getSpectrumAccessOpenMSPtr(exp); |
| 295 | } |
| 296 | |
| 297 | /// Only read the meta data from a file and use it to populate exp_meta |
| 298 | boost::shared_ptr< PeakMap > SwathFile::populateMetaData_(const String& file) |
nothing calls this directly
no test coverage detected