limal
ValuePosixRECheck.hpp
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | _ _ _ _ __ _ |
4 | | | | | | \_/ | / \ | | |
5 | | | | | | |_| | / /\ \ | | |
6 | | |__ | | | | | | / ____ \ | |__ |
7 | |____||_| |_| |_|/ / \ \|____| |
8 | |
9 | core library |
10 | |
11 | (C) SUSE Linux Products GmbH |
12 \----------------------------------------------------------------------/
13 
14  File: ValuePosixRECheck.hpp
15 
16  Author: Marius Tomaschewski
17  Maintainer: Marius Tomaschewski
18 
19  Purpose:
20 
21 /-*/
26 #ifndef LIMAL_VALUE_POSIX_REGEX_CHECK_HPP
27 #define LIMAL_VALUE_POSIX_REGEX_CHECK_HPP
28 
29 #include <limal/config.h>
30 #include <limal/ValueCheck.hpp>
31 
32 #include <blocxx/Types.hpp>
33 #include <blocxx/String.hpp>
34 #include <blocxx/PosixRegEx.hpp>
35 
36 namespace LIMAL_NAMESPACE
37 {
38 
39 // -------------------------------------------------------------------
40 #ifdef BLOCXX_HAVE_REGEX
41 
48 {
49 public:
60  ValuePosixRECheck(const blocxx::String &regex,
61  bool icase = false);
62 
71  virtual bool
72  isValid(const blocxx::String &value) const;
73 
81  virtual blocxx::String
82  explain(const blocxx::String &value) const;
83 
84 private:
85  blocxx::PosixRegEx m_reg;
86 };
87 #else
88 #warning PosixRegEx is not avaliable in blocxx
89 #endif
90 
91 
92 } // End of LIMAL_NAMESPACE
93 #endif // LIMAL_VALUE_POSIX_REGEX_CHECK_HPP
94 // vim: set ts=8 sts=8 sw=8 ai noet: