]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/base/RegexPattern.h
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_SRC_BASE_REGEXPATTERN_H
10 #define SQUID_SRC_BASE_REGEXPATTERN_H
12 #include "compat/GnuRegex.h"
13 #include "mem/forward.h"
16 * A regular expression,
17 * plain text and compiled representations
21 MEMPROXY_CLASS(RegexPattern
);
24 RegexPattern() = delete;
25 RegexPattern(int aFlags
, const char *aPattern
);
28 // regex type varies by library, usually not safe to copy
29 RegexPattern(const RegexPattern
&) = delete;
30 RegexPattern
&operator =(const RegexPattern
&) = delete;
32 RegexPattern(RegexPattern
&&);
33 RegexPattern
&operator =(RegexPattern
&&);
35 const char * c_str() const {return pattern
;}
36 bool match(const char *str
) const {return regexec(®ex
,str
,0,NULL
,0)==0;}
46 #endif /* SQUID_SRC_BASE_REGEXPATTERN_H */