Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:59:26

0001 /*
0002  *
0003  * Copyright (c) 1998-2002
0004  * John Maddock
0005  *
0006  * Use, modification and distribution are subject to the 
0007  * Boost Software License, Version 1.0. (See accompanying file 
0008  * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009  *
0010  */
0011  
0012  /*
0013   *   LOCATION:    see http://www.boost.org for most recent version.
0014   *   FILE         match_flags.hpp
0015   *   VERSION      see <boost/version.hpp>
0016   *   DESCRIPTION: Declares match_flags type.
0017   */
0018 
0019 #ifndef BOOST_REGEX_V4_MATCH_FLAGS
0020 #define BOOST_REGEX_V4_MATCH_FLAGS
0021 
0022 #ifdef __cplusplus
0023 #  include <boost/cstdint.hpp>
0024 #endif
0025 
0026 #ifdef __cplusplus
0027 namespace boost{
0028    namespace regex_constants{
0029 #endif
0030 
0031 #ifdef BOOST_MSVC
0032 #pragma warning(push)
0033 #if BOOST_MSVC >= 1800
0034 #pragma warning(disable : 26812)
0035 #endif
0036 #endif
0037 
0038 typedef enum _match_flags
0039 {
0040    match_default = 0,
0041    match_not_bol = 1,                                /* first is not start of line */
0042    match_not_eol = match_not_bol << 1,               /* last is not end of line */
0043    match_not_bob = match_not_eol << 1,               /* first is not start of buffer */
0044    match_not_eob = match_not_bob << 1,               /* last is not end of buffer */
0045    match_not_bow = match_not_eob << 1,               /* first is not start of word */
0046    match_not_eow = match_not_bow << 1,               /* last is not end of word */
0047    match_not_dot_newline = match_not_eow << 1,       /* \n is not matched by '.' */
0048    match_not_dot_null = match_not_dot_newline << 1,  /* '\0' is not matched by '.' */
0049    match_prev_avail = match_not_dot_null << 1,       /* *--first is a valid expression */
0050    match_init = match_prev_avail << 1,               /* internal use */
0051    match_any = match_init << 1,                      /* don't care what we match */
0052    match_not_null = match_any << 1,                  /* string can't be null */
0053    match_continuous = match_not_null << 1,           /* each grep match must continue from */
0054                                                      /* uninterrupted from the previous one */
0055    match_partial = match_continuous << 1,            /* find partial matches */
0056    
0057    match_stop = match_partial << 1,                  /* stop after first match (grep) V3 only */
0058    match_not_initial_null = match_stop,              /* don't match initial null, V4 only */
0059    match_all = match_stop << 1,                      /* must find the whole of input even if match_any is set */
0060    match_perl = match_all << 1,                      /* Use perl matching rules */
0061    match_posix = match_perl << 1,                    /* Use POSIX matching rules */
0062    match_nosubs = match_posix << 1,                  /* don't trap marked subs */
0063    match_extra = match_nosubs << 1,                  /* include full capture information for repeated captures */
0064    match_single_line = match_extra << 1,             /* treat text as single line and ignore any \n's when matching ^ and $. */
0065    match_unused1 = match_single_line << 1,           /* unused */
0066    match_unused2 = match_unused1 << 1,               /* unused */
0067    match_unused3 = match_unused2 << 1,               /* unused */
0068    match_max = match_unused3,
0069 
0070    format_perl = 0,                                  /* perl style replacement */
0071    format_default = 0,                               /* ditto. */
0072    format_sed = match_max << 1,                      /* sed style replacement. */
0073    format_all = format_sed << 1,                     /* enable all extensions to syntax. */
0074    format_no_copy = format_all << 1,                 /* don't copy non-matching segments. */
0075    format_first_only = format_no_copy << 1,          /* Only replace first occurrence. */
0076    format_is_if = format_first_only << 1,            /* internal use only. */
0077    format_literal = format_is_if << 1,               /* treat string as a literal */
0078 
0079    match_not_any = match_not_bol | match_not_eol | match_not_bob 
0080       | match_not_eob | match_not_bow | match_not_eow | match_not_dot_newline 
0081       | match_not_dot_null | match_prev_avail | match_init | match_not_null
0082       | match_continuous | match_partial | match_stop | match_not_initial_null 
0083       | match_stop | match_all | match_perl | match_posix | match_nosubs
0084       | match_extra | match_single_line | match_unused1 | match_unused2 
0085       | match_unused3 | match_max | format_perl | format_default | format_sed
0086       | format_all | format_no_copy | format_first_only | format_is_if
0087       | format_literal
0088 
0089 
0090 } match_flags;
0091 
0092 #if defined(BOOST_BORLANDC) || (defined(_MSC_VER) && (_MSC_VER <= 1310))
0093 typedef unsigned long match_flag_type;
0094 #else
0095 typedef match_flags match_flag_type;
0096 
0097 
0098 #ifdef __cplusplus
0099 inline match_flags operator&(match_flags m1, match_flags m2)
0100 { return static_cast<match_flags>(static_cast<boost::int32_t>(m1) & static_cast<boost::int32_t>(m2)); }
0101 inline match_flags operator|(match_flags m1, match_flags m2)
0102 { return static_cast<match_flags>(static_cast<boost::int32_t>(m1) | static_cast<boost::int32_t>(m2)); }
0103 inline match_flags operator^(match_flags m1, match_flags m2)
0104 { return static_cast<match_flags>(static_cast<boost::int32_t>(m1) ^ static_cast<boost::int32_t>(m2)); }
0105 inline match_flags operator~(match_flags m1)
0106 { return static_cast<match_flags>(~static_cast<boost::int32_t>(m1)); }
0107 inline match_flags& operator&=(match_flags& m1, match_flags m2)
0108 { m1 = m1&m2; return m1; }
0109 inline match_flags& operator|=(match_flags& m1, match_flags m2)
0110 { m1 = m1|m2; return m1; }
0111 inline match_flags& operator^=(match_flags& m1, match_flags m2)
0112 { m1 = m1^m2; return m1; }
0113 #endif
0114 #endif
0115 
0116 #ifdef __cplusplus
0117 } /* namespace regex_constants */
0118 /*
0119  * import names into boost for backwards compatibility:
0120  */
0121 using regex_constants::match_flag_type;
0122 using regex_constants::match_default;
0123 using regex_constants::match_not_bol;
0124 using regex_constants::match_not_eol;
0125 using regex_constants::match_not_bob;
0126 using regex_constants::match_not_eob;
0127 using regex_constants::match_not_bow;
0128 using regex_constants::match_not_eow;
0129 using regex_constants::match_not_dot_newline;
0130 using regex_constants::match_not_dot_null;
0131 using regex_constants::match_prev_avail;
0132 /* using regex_constants::match_init; */
0133 using regex_constants::match_any;
0134 using regex_constants::match_not_null;
0135 using regex_constants::match_continuous;
0136 using regex_constants::match_partial;
0137 /*using regex_constants::match_stop; */
0138 using regex_constants::match_all;
0139 using regex_constants::match_perl;
0140 using regex_constants::match_posix;
0141 using regex_constants::match_nosubs;
0142 using regex_constants::match_extra;
0143 using regex_constants::match_single_line;
0144 /*using regex_constants::match_max; */
0145 using regex_constants::format_all;
0146 using regex_constants::format_sed;
0147 using regex_constants::format_perl;
0148 using regex_constants::format_default;
0149 using regex_constants::format_no_copy;
0150 using regex_constants::format_first_only;
0151 /*using regex_constants::format_is_if;*/
0152 
0153 #ifdef BOOST_MSVC
0154 #pragma warning(pop)
0155 #endif
0156 
0157 
0158 } /* namespace boost */
0159 #endif /* __cplusplus */
0160 #endif /* include guard */
0161