HAL  v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
hexadecimal_validator.cpp
Go to the documentation of this file.
2 
3 namespace hal
4 {
6  {
7  //if 0x should also be allowed, use ^(0x|0X)?[a-fA-F0-9]+$
9  setFailText("Cosen input must be in hexadecimal format.");
10  }
11 
13  {
14  QString inp = input; int pos = 0;
15  return (mValidator.validate(inp, pos) == QValidator::State::Acceptable) ? true : false;
16  }
17 
18 }
bool validate(const QString &input)
void setFailText(const QString &text)
Definition: validator.cpp:5
Definition: defines.h:45
void setRegularExpression(const QRegularExpression &re)
virtual QValidator::State validate(QString &input, int &pos) const const override