File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: BSD-2-Clause
2+ // Copyright CM4all GmbH
3+ // author: Max Kellermann <max.kellermann@ionos.com>
4+
5+ #pragma once
6+
7+ #include < pcre2.h>
8+
9+ namespace Pcre {
10+
11+ struct CompileOptions {
12+ bool anchored = false ;
13+ bool caseless = false ;
14+ bool capture = false ;
15+
16+ explicit constexpr operator int () const noexcept {
17+ int options = PCRE2_DOTALL |PCRE2_NO_AUTO_CAPTURE ;
18+
19+ if (anchored)
20+ options |= PCRE2_ANCHORED ;
21+
22+ if (caseless)
23+ options |= PCRE2_CASELESS ;
24+
25+ if (capture)
26+ options &= ~PCRE2_NO_AUTO_CAPTURE ;
27+
28+ return options;
29+ }
30+ };
31+
32+ } // namespace Pcre
Original file line number Diff line number Diff line change 44
55#pragma once
66
7+ #include " Options.hxx"
78#include " RegexPointer.hxx"
89
910#include < utility>
1011
11- namespace Pcre {
12-
13- struct CompileOptions {
14- bool anchored = false ;
15- bool caseless = false ;
16- bool capture = false ;
17-
18- explicit constexpr operator int () const noexcept {
19- int options = PCRE2_DOTALL |PCRE2_NO_AUTO_CAPTURE ;
20-
21- if (anchored)
22- options |= PCRE2_ANCHORED ;
23-
24- if (caseless)
25- options |= PCRE2_CASELESS ;
26-
27- if (capture)
28- options &= ~PCRE2_NO_AUTO_CAPTURE ;
29-
30- return options;
31- }
32- };
33-
34- } // namespace Pcre
35-
3612class UniqueRegex : public RegexPointer {
3713public:
3814 UniqueRegex () = default ;
You can’t perform that action at this time.
0 commit comments