Loading...
Searching...
No Matches
AddressValidator.hpp
1#pragma once
2#include <State/Expression.hpp>
3
4#include <QValidator>
5
6namespace State
7{
17class SCORE_LIB_STATE_EXPORT AddressValidator final : public QValidator
18{
19public:
20 virtual ~AddressValidator();
21 QValidator::State validate(QString& s, int& pos) const override
22 {
23 return ::State::Address::validateString(s) ? State::Acceptable : State::Intermediate;
24 }
25};
26
27class SCORE_LIB_STATE_EXPORT AddressAccessorValidator final : public QValidator
28{
29public:
31 QValidator::State validate(QString& s, int& pos) const override
32 {
33 auto res = ::State::parseAddressAccessor(s);
34 return bool(res) ? State::Acceptable : State::Intermediate;
35 }
36};
37
38class SCORE_LIB_STATE_EXPORT AddressFragmentValidator : public QValidator
39{
40public:
41 using QValidator::QValidator;
43 QValidator::State validate(QString& s, int& pos) const override
44 {
45 return ::State::Address::validateFragment(s) ? QValidator::State::Acceptable
46 : QValidator::State::Invalid;
47 }
48};
49}
Definition AddressValidator.hpp:28
Definition AddressValidator.hpp:39
The AddressValidator class.
Definition AddressValidator.hpp:18
Utilities for OSSIA data structures.
Definition DeviceInterface.hpp:33