1 /** 2 * UGENE - Integrated Bioinformatics Tools. 3 * Copyright (C) 2008-2021 UniPro <ugene@unipro.ru> 4 * http://ugene.net 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 9 * of the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 * MA 02110-1301, USA. 20 */ 21 22 #ifndef _U2_RAW_DATA_CHECK_H_ 23 #define _U2_RAW_DATA_CHECK_H_ 24 25 #include <QVariantMap> 26 27 namespace U2 { 28 29 // Result of the format detection algorithm 30 // Note: High/Very High, Low/Very low selection is the result of the quality of detection algorithm 31 // For example if detection algorithm is not advanced enough it must not use VeryHigh rating 32 enum FormatDetectionScore { 33 FormatDetection_NotMatched = -10, // format is not matched and can't be parsed at all 34 FormatDetection_VeryLowSimilarity = 1, // very low similarity found. Parsing is allowed 35 FormatDetection_LowSimilarity = 2, // save as very low, but slightly better, used as extra step in cross-formats differentiation 36 FormatDetection_AverageSimilarity = 3, // see above 37 FormatDetection_HighSimilarity = 4, // see above 38 FormatDetection_VeryHighSimilarity = 5, // see above 39 FormatDetection_Matched = 10 // here we 100% sure that we deal with a known and supported format. 40 }; 41 42 /** The result of the document format detection: score and additional info that was parsed during raw data check */ 43 class FormatCheckResult { 44 public: FormatCheckResult()45 FormatCheckResult() 46 : score(FormatDetection_NotMatched) { 47 } FormatCheckResult(FormatDetectionScore _score)48 FormatCheckResult(FormatDetectionScore _score) 49 : score(_score) { 50 } 51 52 /** Score of the detection */ 53 int score; 54 55 QVariantMap properties; 56 }; 57 58 } // namespace U2 59 60 #endif 61