]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/regex/include/boost/regex/v4/match_flags.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / regex / include / boost / regex / v4 / match_flags.hpp
1 /*
2 *
3 * Copyright (c) 1998-2002
4 * John Maddock
5 *
6 * Use, modification and distribution are subject to the
7 * Boost Software License, Version 1.0. (See accompanying file
8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 *
10 */
11
12 /*
13 * LOCATION: see http://www.boost.org for most recent version.
14 * FILE match_flags.hpp
15 * VERSION see <boost/version.hpp>
16 * DESCRIPTION: Declares match_flags type.
17 */
18
19 #ifndef BOOST_REGEX_V4_MATCH_FLAGS
20 #define BOOST_REGEX_V4_MATCH_FLAGS
21
22 #ifdef __cplusplus
23 # include <boost/cstdint.hpp>
24 #endif
25 #include <boost/detail/workaround.hpp>
26
27 #ifdef __cplusplus
28 namespace boost{
29 namespace regex_constants{
30 #endif
31
32 typedef enum _match_flags
33 {
34 match_default = 0,
35 match_not_bol = 1, /* first is not start of line */
36 match_not_eol = match_not_bol << 1, /* last is not end of line */
37 match_not_bob = match_not_eol << 1, /* first is not start of buffer */
38 match_not_eob = match_not_bob << 1, /* last is not end of buffer */
39 match_not_bow = match_not_eob << 1, /* first is not start of word */
40 match_not_eow = match_not_bow << 1, /* last is not end of word */
41 match_not_dot_newline = match_not_eow << 1, /* \n is not matched by '.' */
42 match_not_dot_null = match_not_dot_newline << 1, /* '\0' is not matched by '.' */
43 match_prev_avail = match_not_dot_null << 1, /* *--first is a valid expression */
44 match_init = match_prev_avail << 1, /* internal use */
45 match_any = match_init << 1, /* don't care what we match */
46 match_not_null = match_any << 1, /* string can't be null */
47 match_continuous = match_not_null << 1, /* each grep match must continue from */
48 /* uninterupted from the previous one */
49 match_partial = match_continuous << 1, /* find partial matches */
50
51 match_stop = match_partial << 1, /* stop after first match (grep) V3 only */
52 match_not_initial_null = match_stop, /* don't match initial null, V4 only */
53 match_all = match_stop << 1, /* must find the whole of input even if match_any is set */
54 match_perl = match_all << 1, /* Use perl matching rules */
55 match_posix = match_perl << 1, /* Use POSIX matching rules */
56 match_nosubs = match_posix << 1, /* don't trap marked subs */
57 match_extra = match_nosubs << 1, /* include full capture information for repeated captures */
58 match_single_line = match_extra << 1, /* treat text as single line and ignor any \n's when matching ^ and $. */
59 match_unused1 = match_single_line << 1, /* unused */
60 match_unused2 = match_unused1 << 1, /* unused */
61 match_unused3 = match_unused2 << 1, /* unused */
62 match_max = match_unused3,
63
64 format_perl = 0, /* perl style replacement */
65 format_default = 0, /* ditto. */
66 format_sed = match_max << 1, /* sed style replacement. */
67 format_all = format_sed << 1, /* enable all extentions to sytax. */
68 format_no_copy = format_all << 1, /* don't copy non-matching segments. */
69 format_first_only = format_no_copy << 1, /* Only replace first occurance. */
70 format_is_if = format_first_only << 1, /* internal use only. */
71 format_literal = format_is_if << 1 /* treat string as a literal */
72
73 } match_flags;
74
75 #if defined(__BORLANDC__) || BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
76 typedef unsigned long match_flag_type;
77 #else
78 typedef match_flags match_flag_type;
79
80
81 #ifdef __cplusplus
82 inline match_flags operator&(match_flags m1, match_flags m2)
83 { return static_cast<match_flags>(static_cast<boost::int32_t>(m1) & static_cast<boost::int32_t>(m2)); }
84 inline match_flags operator|(match_flags m1, match_flags m2)
85 { return static_cast<match_flags>(static_cast<boost::int32_t>(m1) | static_cast<boost::int32_t>(m2)); }
86 inline match_flags operator^(match_flags m1, match_flags m2)
87 { return static_cast<match_flags>(static_cast<boost::int32_t>(m1) ^ static_cast<boost::int32_t>(m2)); }
88 inline match_flags operator~(match_flags m1)
89 { return static_cast<match_flags>(~static_cast<boost::int32_t>(m1)); }
90 inline match_flags& operator&=(match_flags& m1, match_flags m2)
91 { m1 = m1&m2; return m1; }
92 inline match_flags& operator|=(match_flags& m1, match_flags m2)
93 { m1 = m1|m2; return m1; }
94 inline match_flags& operator^=(match_flags& m1, match_flags m2)
95 { m1 = m1^m2; return m1; }
96 #endif
97 #endif
98
99 #ifdef __cplusplus
100 } /* namespace regex_constants */
101 /*
102 * import names into boost for backwards compatiblity:
103 */
104 using regex_constants::match_flag_type;
105 using regex_constants::match_default;
106 using regex_constants::match_not_bol;
107 using regex_constants::match_not_eol;
108 using regex_constants::match_not_bob;
109 using regex_constants::match_not_eob;
110 using regex_constants::match_not_bow;
111 using regex_constants::match_not_eow;
112 using regex_constants::match_not_dot_newline;
113 using regex_constants::match_not_dot_null;
114 using regex_constants::match_prev_avail;
115 /* using regex_constants::match_init; */
116 using regex_constants::match_any;
117 using regex_constants::match_not_null;
118 using regex_constants::match_continuous;
119 using regex_constants::match_partial;
120 /*using regex_constants::match_stop; */
121 using regex_constants::match_all;
122 using regex_constants::match_perl;
123 using regex_constants::match_posix;
124 using regex_constants::match_nosubs;
125 using regex_constants::match_extra;
126 using regex_constants::match_single_line;
127 /*using regex_constants::match_max; */
128 using regex_constants::format_all;
129 using regex_constants::format_sed;
130 using regex_constants::format_perl;
131 using regex_constants::format_default;
132 using regex_constants::format_no_copy;
133 using regex_constants::format_first_only;
134 /*using regex_constants::format_is_if;*/
135
136 } /* namespace boost */
137 #endif /* __cplusplus */
138 #endif /* include guard */
139