comparison transform/CSVFeatureWriter.cpp @ 604:4541581067f3

* Better handling of failed-to-open-output-stream situations; ensure CSV writer closes files when they're finished rather than when it's finished
author Chris Cannam
date Tue, 08 Sep 2009 16:52:36 +0000
parents 6acdddf6f99e
children a41b4e30e3d9
comparison
equal deleted inserted replaced
603:e43368ec5ff0 604:4541581067f3
77 { 77 {
78 // Select appropriate output file for our track/transform 78 // Select appropriate output file for our track/transform
79 // combination 79 // combination
80 80
81 QTextStream *sptr = getOutputStream(trackId, transform.getIdentifier()); 81 QTextStream *sptr = getOutputStream(trackId, transform.getIdentifier());
82 if (!sptr) return; //!!! this is probably better handled with an exception 82 if (!sptr) {
83 throw FailedToOpenOutputStream(trackId, transform.getIdentifier());
84 }
83 85
84 QTextStream &stream = *sptr; 86 QTextStream &stream = *sptr;
85 87
86 for (unsigned int i = 0; i < features.size(); ++i) { 88 for (unsigned int i = 0; i < features.size(); ++i) {
87 89