limal
ValuePerlRECheck.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: ValuePerlRECheck.hpp
15 
16  Author: Marius Tomaschewski
17  Maintainer: Marius Tomaschewski
18 
19  Purpose:
20 
21 /-*/
26 #ifndef LIMAL_VALUE_PERL_REGEX_CHECK_HPP
27 #define LIMAL_VALUE_PERL_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/PerlRegEx.hpp>
35 
36 namespace LIMAL_NAMESPACE
37 {
38 
39 // -------------------------------------------------------------------
40 #ifdef BLOCXX_HAVE_PCRE
41 
48 {
49 public:
62  ValuePerlRECheck(const blocxx::String &regex,
63  bool icase = false,
64  bool utf8 = false);
65 
74  virtual bool
75  isValid(const blocxx::String &value) const;
76 
84  virtual blocxx::String
85  explain(const blocxx::String &value) const;
86 
87 private:
88  blocxx::PerlRegEx m_reg;
89 };
90 #else
91 #warning PerlRegEx is not avaliable in blocxx
92 #endif
93 
94 
95 } // End of LIMAL_NAMESPACE
96 #endif // LIMAL_VALUE_PERL_REGEX_CHECK_HPP
97 // vim: set ts=8 sts=8 sw=8 ai noet: