Line data Source code
1 : // DUNE DAQ modification notice:
2 : // This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3 : // Fork baseline commit: dbe-02-12-17 (2022-05-12).
4 : // Renamed since fork: no.
5 :
6 : /// Including DBE
7 : #include "dbe/Validator.hpp"
8 :
9 0 : dbe::ValidatorAcceptMatch::ValidatorAcceptMatch(QVariant& Storage, QObject* parent)
10 0 : : QValidator(parent)
11 : {
12 0 : List = Storage.toStringList();
13 0 : }
14 :
15 : QValidator::State
16 0 : dbe::ValidatorAcceptMatch::validate(QString& Input, int& Position) const
17 : {
18 0 : Q_UNUSED(Position)
19 :
20 0 : for (const QString& Name : List) {
21 0 : if (Name.compare(Input) == 0) {
22 0 : return QValidator::Acceptable;
23 : }
24 : }
25 :
26 0 : return QValidator::Intermediate;
27 : }
28 :
29 0 : dbe::ValidatorAcceptNoMatch::ValidatorAcceptNoMatch(QVariant& Storage, QObject* parent)
30 0 : : QValidator(parent)
31 : {
32 0 : List = Storage.toStringList();
33 0 : }
34 :
35 : QValidator::State
36 0 : dbe::ValidatorAcceptNoMatch::validate(QString& Input, int& Position) const
37 : {
38 0 : Q_UNUSED(Position)
39 :
40 0 : for (const QString& Name : List) {
41 0 : if (Name.compare(Input) == 0) {
42 0 : return QValidator::Intermediate;
43 : }
44 : }
45 :
46 0 : return QValidator::Acceptable;
47 : }
|