Chris@16: /* Chris@16: * Chris@16: * Copyright (c) 1998-2002 Chris@16: * John Maddock Chris@16: * Chris@16: * Use, modification and distribution are subject to the Chris@16: * Boost Software License, Version 1.0. (See accompanying file Chris@16: * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Chris@16: */ Chris@16: Chris@16: /* Chris@16: * LOCATION: see http://www.boost.org for most recent version. Chris@16: * FILE match_flags.hpp Chris@16: * VERSION see Chris@16: * DESCRIPTION: Declares match_flags type. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_REGEX_V4_MATCH_FLAGS Chris@16: #define BOOST_REGEX_V4_MATCH_FLAGS Chris@16: Chris@16: #ifdef __cplusplus Chris@16: # include Chris@16: #endif Chris@16: Chris@16: #ifdef __cplusplus Chris@16: namespace boost{ Chris@16: namespace regex_constants{ Chris@16: #endif Chris@16: Chris@16: typedef enum _match_flags Chris@16: { Chris@16: match_default = 0, Chris@16: match_not_bol = 1, /* first is not start of line */ Chris@16: match_not_eol = match_not_bol << 1, /* last is not end of line */ Chris@16: match_not_bob = match_not_eol << 1, /* first is not start of buffer */ Chris@16: match_not_eob = match_not_bob << 1, /* last is not end of buffer */ Chris@16: match_not_bow = match_not_eob << 1, /* first is not start of word */ Chris@16: match_not_eow = match_not_bow << 1, /* last is not end of word */ Chris@16: match_not_dot_newline = match_not_eow << 1, /* \n is not matched by '.' */ Chris@16: match_not_dot_null = match_not_dot_newline << 1, /* '\0' is not matched by '.' */ Chris@16: match_prev_avail = match_not_dot_null << 1, /* *--first is a valid expression */ Chris@16: match_init = match_prev_avail << 1, /* internal use */ Chris@16: match_any = match_init << 1, /* don't care what we match */ Chris@16: match_not_null = match_any << 1, /* string can't be null */ Chris@16: match_continuous = match_not_null << 1, /* each grep match must continue from */ Chris@16: /* uninterupted from the previous one */ Chris@16: match_partial = match_continuous << 1, /* find partial matches */ Chris@16: Chris@16: match_stop = match_partial << 1, /* stop after first match (grep) V3 only */ Chris@16: match_not_initial_null = match_stop, /* don't match initial null, V4 only */ Chris@16: match_all = match_stop << 1, /* must find the whole of input even if match_any is set */ Chris@16: match_perl = match_all << 1, /* Use perl matching rules */ Chris@16: match_posix = match_perl << 1, /* Use POSIX matching rules */ Chris@16: match_nosubs = match_posix << 1, /* don't trap marked subs */ Chris@16: match_extra = match_nosubs << 1, /* include full capture information for repeated captures */ Chris@16: match_single_line = match_extra << 1, /* treat text as single line and ignor any \n's when matching ^ and $. */ Chris@16: match_unused1 = match_single_line << 1, /* unused */ Chris@16: match_unused2 = match_unused1 << 1, /* unused */ Chris@16: match_unused3 = match_unused2 << 1, /* unused */ Chris@16: match_max = match_unused3, Chris@16: Chris@16: format_perl = 0, /* perl style replacement */ Chris@16: format_default = 0, /* ditto. */ Chris@16: format_sed = match_max << 1, /* sed style replacement. */ Chris@16: format_all = format_sed << 1, /* enable all extentions to sytax. */ Chris@16: format_no_copy = format_all << 1, /* don't copy non-matching segments. */ Chris@16: format_first_only = format_no_copy << 1, /* Only replace first occurance. */ Chris@16: format_is_if = format_first_only << 1, /* internal use only. */ Chris@16: format_literal = format_is_if << 1 /* treat string as a literal */ Chris@16: Chris@16: } match_flags; Chris@16: Chris@101: #if defined(__BORLANDC__) Chris@16: typedef unsigned long match_flag_type; Chris@16: #else Chris@16: typedef match_flags match_flag_type; Chris@16: Chris@16: Chris@16: #ifdef __cplusplus Chris@16: inline match_flags operator&(match_flags m1, match_flags m2) Chris@16: { return static_cast(static_cast(m1) & static_cast(m2)); } Chris@16: inline match_flags operator|(match_flags m1, match_flags m2) Chris@16: { return static_cast(static_cast(m1) | static_cast(m2)); } Chris@16: inline match_flags operator^(match_flags m1, match_flags m2) Chris@16: { return static_cast(static_cast(m1) ^ static_cast(m2)); } Chris@16: inline match_flags operator~(match_flags m1) Chris@16: { return static_cast(~static_cast(m1)); } Chris@16: inline match_flags& operator&=(match_flags& m1, match_flags m2) Chris@16: { m1 = m1&m2; return m1; } Chris@16: inline match_flags& operator|=(match_flags& m1, match_flags m2) Chris@16: { m1 = m1|m2; return m1; } Chris@16: inline match_flags& operator^=(match_flags& m1, match_flags m2) Chris@16: { m1 = m1^m2; return m1; } Chris@16: #endif Chris@16: #endif Chris@16: Chris@16: #ifdef __cplusplus Chris@16: } /* namespace regex_constants */ Chris@16: /* Chris@16: * import names into boost for backwards compatiblity: Chris@16: */ Chris@16: using regex_constants::match_flag_type; Chris@16: using regex_constants::match_default; Chris@16: using regex_constants::match_not_bol; Chris@16: using regex_constants::match_not_eol; Chris@16: using regex_constants::match_not_bob; Chris@16: using regex_constants::match_not_eob; Chris@16: using regex_constants::match_not_bow; Chris@16: using regex_constants::match_not_eow; Chris@16: using regex_constants::match_not_dot_newline; Chris@16: using regex_constants::match_not_dot_null; Chris@16: using regex_constants::match_prev_avail; Chris@16: /* using regex_constants::match_init; */ Chris@16: using regex_constants::match_any; Chris@16: using regex_constants::match_not_null; Chris@16: using regex_constants::match_continuous; Chris@16: using regex_constants::match_partial; Chris@16: /*using regex_constants::match_stop; */ Chris@16: using regex_constants::match_all; Chris@16: using regex_constants::match_perl; Chris@16: using regex_constants::match_posix; Chris@16: using regex_constants::match_nosubs; Chris@16: using regex_constants::match_extra; Chris@16: using regex_constants::match_single_line; Chris@16: /*using regex_constants::match_max; */ Chris@16: using regex_constants::format_all; Chris@16: using regex_constants::format_sed; Chris@16: using regex_constants::format_perl; Chris@16: using regex_constants::format_default; Chris@16: using regex_constants::format_no_copy; Chris@16: using regex_constants::format_first_only; Chris@16: /*using regex_constants::format_is_if;*/ Chris@16: Chris@16: } /* namespace boost */ Chris@16: #endif /* __cplusplus */ Chris@16: #endif /* include guard */ Chris@16: