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 _MARKER_UTILS_H_
23 #define _MARKER_UTILS_H_
24 
25 #include <U2Lang/Marker.h>
26 
27 namespace U2 {
28 
29 class U2LANG_EXPORT MarkerUtils {
30 public:
31     static bool stringToValue(MarkerDataType dataType, const QString &string, QVariantList &value);
32     static void valueToString(MarkerDataType dataType, const QVariantList &value, QString &string);
33 
34     static const QString INTERVAL_OPERATION;
35     static const QString LESS_OPERATION;
36     static const QString GREATER_OPERATION;
37     static const QString STARTS_OPERATION;
38     static const QString ENDS_OPERATION;
39     static const QString CONTAINS_OPERATION;
40     static const QString REGEXP_OPERATION;
41 
42     static const QString REST_OPERATION;
43 
44 private:
45     static bool stringToIntValue(const QString &string, QVariantList &value);
46     static bool stringToFloatValue(const QString &string, QVariantList &value);
47     static bool stringToTextValue(const QString &string, QVariantList &value);
48 
49     static void integerValueToString(const QVariantList &value, QString &string);
50     static void floatValueToString(const QVariantList &value, QString &string);
51     static void textValueToString(const QVariantList &value, QString &string);
52 };
53 
54 }  // namespace U2
55 
56 #endif  // _MARKER_UTILS_H_
57