DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Validator.cpp
Go to the documentation of this file.
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
7#include "dbe/Validator.hpp"
8
9dbe::ValidatorAcceptMatch::ValidatorAcceptMatch ( QVariant & Storage, QObject * parent )
10 : QValidator ( parent )
11{
12 List = Storage.toStringList();
13}
14
15QValidator::State dbe::ValidatorAcceptMatch::validate ( QString & Input,
16 int & Position ) const
17{
18 Q_UNUSED ( Position )
19
20 for ( const QString & Name : List )
21 {
22 if ( Name.compare ( Input ) == 0 )
23 {
24 return QValidator::Acceptable;
25 }
26 }
27
28 return QValidator::Intermediate;
29}
30
31dbe::ValidatorAcceptNoMatch::ValidatorAcceptNoMatch ( QVariant & Storage, QObject * parent )
32 : QValidator ( parent )
33{
34 List = Storage.toStringList();
35}
36
37QValidator::State dbe::ValidatorAcceptNoMatch::validate ( QString & Input,
38 int & Position ) const
39{
40 Q_UNUSED ( Position )
41
42 for ( const QString & Name : List )
43 {
44 if ( Name.compare ( Input ) == 0 )
45 {
46 return QValidator::Intermediate;
47 }
48 }
49
50 return QValidator::Acceptable;
51}
ValidatorAcceptMatch(QVariant &Storage, QObject *parent=0)
Including DBE.
Definition Validator.cpp:9
QValidator::State validate(QString &Input, int &Position) const
Definition Validator.cpp:15
ValidatorAcceptNoMatch(QVariant &Storage, QObject *parent=0)
Definition Validator.cpp:31
QValidator::State validate(QString &Input, int &Position) const
Definition Validator.cpp:37