OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
idvalidator.hpp
Go to the documentation of this file.
1 #ifndef CSV_WORLD_IDVALIDATOR_H
2 #define CSV_WORLD_IDVALIDATOR_H
3 
4 #include <string>
5 
6 #include <QValidator>
7 
8 namespace CSVWorld
9 {
10  class IdValidator : public QValidator
11  {
12  bool mRelaxed;
13  std::string mNamespace;
14  mutable std::string mError;
15 
16  private:
17 
18  bool isValid (const QChar& c, bool first) const;
19 
20  public:
21 
22  IdValidator (bool relaxed = false, QObject *parent = 0);
24 
25  virtual State validate (QString& input, int& pos) const;
26 
27  void setNamespace (const std::string& namespace_);
28 
33  std::string getError() const;
34 
35  };
36 }
37 
38 #endif
void setNamespace(const std::string &namespace_)
Definition: idvalidator.cpp:114
Definition: idvalidator.hpp:10
std::string mNamespace
Definition: idvalidator.hpp:13
IdValidator(bool relaxed=false, QObject *parent=0)
Definition: idvalidator.cpp:16
virtual State validate(QString &input, int &pos) const
Definition: idvalidator.cpp:20
bool mRelaxed
Definition: idvalidator.hpp:12
std::string getError() const
Definition: idvalidator.cpp:119
bool isValid(const QChar &c, bool first) const
Definition: idvalidator.cpp:5
State
Definition: state.hpp:6
std::string mError
Definition: idvalidator.hpp:14