| 28 | class csvOutput : public MatrixOutput |
| 29 | { |
| 30 | Q_OBJECT |
| 31 | |
| 32 | ~csvOutput() |
| 33 | { |
| 34 | if (file.isNull() || targetFiles.isEmpty() || queryFiles.isEmpty()) return; |
| 35 | QStringList lines; |
| 36 | lines.append("File," + targetFiles.names().join(",")); |
| 37 | for (int i=0; i<queryFiles.size(); i++) { |
| 38 | QStringList words; |
| 39 | for (int j=0; j<targetFiles.size(); j++) |
| 40 | words.append(toString(i,j)); // The toString idiom is used to output match scores - see MatrixOutput |
| 41 | lines.append(queryFiles[i].name+","+words.join(",")); |
| 42 | } |
| 43 | QtUtils::writeFile(file, lines); |
| 44 | } |
| 45 | }; |
| 46 | |
| 47 | BR_REGISTER(Output, csvOutput) |