Skip to content

Commit 2a0e1f9

Browse files
committed
namespaces fixed
1 parent ae97e6f commit 2a0e1f9

2 files changed

Lines changed: 63 additions & 59 deletions

File tree

include/pcre2cpp/regex_compile_options.hpp

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,47 @@
1414
#pragma once
1515
#include "pcre2cpp_types.hpp"
1616

17-
enum class regex_compile_options_bits : uint32_t {
18-
NONE = 0u, // No options set (default)
19-
ANCHORED = PCRE2_ANCHORED, // Force pattern anchoring
20-
ALLOW_EMPTY_CLASS = PCRE2_ALLOW_EMPTY_CLASS, // Allow empty classes
21-
ALT_BSUX = PCRE2_ALT_BSUX, // Alternative handling of \u, \U, and \x
22-
ALT_CIRCUMFLEX = PCRE2_ALT_CIRCUMFLEX, // Alternative handling of ^ in multiline mode
23-
ALT_VERBNAMES = PCRE2_ALT_VERBNAMES, // Process backslashes in verb names
24-
AUTO_CALLOUT = PCRE2_AUTO_CALLOUT, // Compile automatic callouts
25-
CASELESS = PCRE2_CASELESS, // Do caseless matching
26-
DOLLAR_ENDONLY = PCRE2_DOLLAR_ENDONLY, // $ not to match newline at end
27-
DOTALL = PCRE2_DOTALL, // . matches anything including NL
28-
DUPNAMES = PCRE2_DUPNAMES, // Allow duplicate names for subpatterns
29-
ENDANCHORED = PCRE2_ENDANCHORED, // Pattern can match only at end of subject
30-
EXTENDED = PCRE2_EXTENDED, // Ignore white space and # comments
31-
FIRSTLINE = PCRE2_FIRSTLINE, // Force matching to be before newline
32-
LITERAL = PCRE2_LITERAL, // Pattern characters are all literal
33-
MATCH_INVALID_UTF = PCRE2_MATCH_INVALID_UTF, // Enable support for matching invalid UTF
34-
MATCH_UNSET_BACKREF = PCRE2_MATCH_UNSET_BACKREF, // Match unset backreferences
35-
MULTILINE = PCRE2_MULTILINE, // ^ and $ match newlines within data
36-
NEVER_BACKSLASH_C = PCRE2_NEVER_BACKSLASH_C, // Lock out the use of \C in patterns
37-
NEVER_UCP = PCRE2_NEVER_UCP, // Lock out PCRE2_UCP, e.g.via(*UCP)
38-
NEVER_UTF = PCRE2_NEVER_UTF, // Lock out PCRE2_UTF, e.g.via(*UTF)
39-
NO_AUTO_CAPTURE = PCRE2_NO_AUTO_CAPTURE, // Disable numbered capturing paren - theses(named ones available)
40-
NO_AUTO_POSSESS = PCRE2_NO_AUTO_POSSESS, // Disable auto - possessification
41-
NO_DOTSTAR_ANCHOR = PCRE2_NO_DOTSTAR_ANCHOR, // Disable automatic anchoring for .*
42-
NO_START_OPTIMIZE = PCRE2_NO_START_OPTIMIZE, // Disable match - time start optimizations
43-
NO_UTF_CHECK = PCRE2_NO_UTF_CHECK, // Do not check the pattern for UTF validity (only relevant if PCRE2_UTF is set)
44-
UCP = PCRE2_UCP, // Use Unicode properties for \d, \w, etc.
45-
UNGREEDY = PCRE2_UNGREEDY, // Invert greediness of quantifiers
46-
USE_OFFSET_LIMIT = PCRE2_USE_OFFSET_LIMIT, // Enable offset limit for unanchored matching
47-
UTF = PCRE2_UTF // Treat pattern and subjects as UTF strings
48-
};
17+
namespace pcre2cpp {
18+
enum class regex_compile_options_bits : uint32_t {
19+
NONE = 0u, // No options set (default)
20+
ANCHORED = PCRE2_ANCHORED, // Force pattern anchoring
21+
ALLOW_EMPTY_CLASS = PCRE2_ALLOW_EMPTY_CLASS, // Allow empty classes
22+
ALT_BSUX = PCRE2_ALT_BSUX, // Alternative handling of \u, \U, and \x
23+
ALT_CIRCUMFLEX = PCRE2_ALT_CIRCUMFLEX, // Alternative handling of ^ in multiline mode
24+
ALT_VERBNAMES = PCRE2_ALT_VERBNAMES, // Process backslashes in verb names
25+
AUTO_CALLOUT = PCRE2_AUTO_CALLOUT, // Compile automatic callouts
26+
CASELESS = PCRE2_CASELESS, // Do caseless matching
27+
DOLLAR_ENDONLY = PCRE2_DOLLAR_ENDONLY, // $ not to match newline at end
28+
DOTALL = PCRE2_DOTALL, // . matches anything including NL
29+
DUPNAMES = PCRE2_DUPNAMES, // Allow duplicate names for subpatterns
30+
ENDANCHORED = PCRE2_ENDANCHORED, // Pattern can match only at end of subject
31+
EXTENDED = PCRE2_EXTENDED, // Ignore white space and # comments
32+
FIRSTLINE = PCRE2_FIRSTLINE, // Force matching to be before newline
33+
LITERAL = PCRE2_LITERAL, // Pattern characters are all literal
34+
MATCH_INVALID_UTF = PCRE2_MATCH_INVALID_UTF, // Enable support for matching invalid UTF
35+
MATCH_UNSET_BACKREF = PCRE2_MATCH_UNSET_BACKREF, // Match unset backreferences
36+
MULTILINE = PCRE2_MULTILINE, // ^ and $ match newlines within data
37+
NEVER_BACKSLASH_C = PCRE2_NEVER_BACKSLASH_C, // Lock out the use of \C in patterns
38+
NEVER_UCP = PCRE2_NEVER_UCP, // Lock out PCRE2_UCP, e.g.via(*UCP)
39+
NEVER_UTF = PCRE2_NEVER_UTF, // Lock out PCRE2_UTF, e.g.via(*UTF)
40+
NO_AUTO_CAPTURE = PCRE2_NO_AUTO_CAPTURE, // Disable numbered capturing paren - theses(named ones available)
41+
NO_AUTO_POSSESS = PCRE2_NO_AUTO_POSSESS, // Disable auto - possessification
42+
NO_DOTSTAR_ANCHOR = PCRE2_NO_DOTSTAR_ANCHOR, // Disable automatic anchoring for .*
43+
NO_START_OPTIMIZE = PCRE2_NO_START_OPTIMIZE, // Disable match - time start optimizations
44+
NO_UTF_CHECK = PCRE2_NO_UTF_CHECK, // Do not check the pattern for UTF validity (only relevant if PCRE2_UTF is set)
45+
UCP = PCRE2_UCP, // Use Unicode properties for \d, \w, etc.
46+
UNGREEDY = PCRE2_UNGREEDY, // Invert greediness of quantifiers
47+
USE_OFFSET_LIMIT = PCRE2_USE_OFFSET_LIMIT, // Enable offset limit for unanchored matching
48+
UTF = PCRE2_UTF // Treat pattern and subjects as UTF strings
49+
};
4950

50-
using regex_compile_options = uint32_t;
51+
using regex_compile_options = uint32_t;
5152

52-
constexpr static regex_compile_options operator| (const regex_compile_options_bits& opt0, const regex_compile_options_bits& opt1) {
53-
return static_cast<regex_compile_options>(static_cast<uint32_t>(opt0) | static_cast<uint32_t>(opt1));
54-
}
53+
constexpr static regex_compile_options operator| (const regex_compile_options_bits& opt0, const regex_compile_options_bits& opt1) {
54+
return static_cast<regex_compile_options>(static_cast<uint32_t>(opt0) | static_cast<uint32_t>(opt1));
55+
}
5556

56-
constexpr static regex_compile_options operator| (const regex_compile_options& opts, const regex_compile_options_bits& opt) {
57-
return static_cast<regex_compile_options>(opts | static_cast<uint32_t>(opt));
57+
constexpr static regex_compile_options operator| (const regex_compile_options& opts, const regex_compile_options_bits& opt) {
58+
return static_cast<regex_compile_options>(opts | static_cast<uint32_t>(opt));
59+
}
5860
}

include/pcre2cpp/regex_match_options.hpp

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,30 @@
1414
#pragma once
1515
#include "pcre2cpp_types.hpp"
1616

17-
enum class regex_match_options_bits : uint32_t {
18-
NONE = 0u, // No options set (default)
19-
ANCHORED = PCRE2_ANCHORED, // Match only at the first position
20-
COPY_MATCHED_SUBJECT = PCRE2_COPY_MATCHED_SUBJECT, // On success, make a private subject copy
21-
DISABLE_RECURSELOOP_CHECK = PCRE2_DISABLE_RECURSELOOP_CHECK, // Only useful in rare cases; use with care
22-
ENDANCHORED = PCRE2_ENDANCHORED, // Pattern can match only at end of subject
23-
NOTBOL = PCRE2_NOTBOL, // Subject string is not the beginning of a line
24-
NOTEOL = PCRE2_NOTEOL, // Subject string is not the end of a line
25-
NOTEMPTY = PCRE2_NOTEMPTY, // An empty string is not a valid match
26-
NOTEMPTY_ATSTART = PCRE2_NOTEMPTY_ATSTART, // An empty string at the start of the subject is not a valid match
27-
NO_JIT = PCRE2_NO_JIT, // Do not use JIT matching
28-
NO_UTF_CHECK = PCRE2_NO_UTF_CHECK, // Do not check the subject for UTF validity(only relevant if PCRE2_UTF was set at compile time)
29-
PARTIAL_HARD = PCRE2_PARTIAL_HARD, // Return PCRE2_ERROR_PARTIAL for a partial match even if there is a full match
30-
PARTIAL_SOFT = PCRE2_PARTIAL_SOFT // Return PCRE2_ERROR_PARTIAL for a partial match if no full matches are found
31-
};
17+
namespace pcre2cpp {
18+
enum class regex_match_options_bits : uint32_t {
19+
NONE = 0u, // No options set (default)
20+
ANCHORED = PCRE2_ANCHORED, // Match only at the first position
21+
COPY_MATCHED_SUBJECT = PCRE2_COPY_MATCHED_SUBJECT, // On success, make a private subject copy
22+
DISABLE_RECURSELOOP_CHECK = PCRE2_DISABLE_RECURSELOOP_CHECK, // Only useful in rare cases; use with care
23+
ENDANCHORED = PCRE2_ENDANCHORED, // Pattern can match only at end of subject
24+
NOTBOL = PCRE2_NOTBOL, // Subject string is not the beginning of a line
25+
NOTEOL = PCRE2_NOTEOL, // Subject string is not the end of a line
26+
NOTEMPTY = PCRE2_NOTEMPTY, // An empty string is not a valid match
27+
NOTEMPTY_ATSTART = PCRE2_NOTEMPTY_ATSTART, // An empty string at the start of the subject is not a valid match
28+
NO_JIT = PCRE2_NO_JIT, // Do not use JIT matching
29+
NO_UTF_CHECK = PCRE2_NO_UTF_CHECK, // Do not check the subject for UTF validity(only relevant if PCRE2_UTF was set at compile time)
30+
PARTIAL_HARD = PCRE2_PARTIAL_HARD, // Return PCRE2_ERROR_PARTIAL for a partial match even if there is a full match
31+
PARTIAL_SOFT = PCRE2_PARTIAL_SOFT // Return PCRE2_ERROR_PARTIAL for a partial match if no full matches are found
32+
};
3233

33-
using regex_match_options = uint32_t;
34+
using regex_match_options = uint32_t;
3435

35-
constexpr static regex_match_options operator| (const regex_match_options_bits& opt0, const regex_match_options_bits& opt1) {
36-
return static_cast<regex_match_options>(static_cast<uint32_t>(opt0) | static_cast<uint32_t>(opt1));
37-
}
36+
constexpr static regex_match_options operator| (const regex_match_options_bits& opt0, const regex_match_options_bits& opt1) {
37+
return static_cast<regex_match_options>(static_cast<uint32_t>(opt0) | static_cast<uint32_t>(opt1));
38+
}
3839

39-
constexpr static regex_match_options operator| (const regex_match_options& opts, const regex_match_options_bits& opt) {
40-
return static_cast<regex_match_options>(opts | static_cast<uint32_t>(opt));
40+
constexpr static regex_match_options operator| (const regex_match_options& opts, const regex_match_options_bits& opt) {
41+
return static_cast<regex_match_options>(opts | static_cast<uint32_t>(opt));
42+
}
4143
}

0 commit comments

Comments
 (0)