imgtools/imglib/boostlibrary/boost/regex/icu.hpp
author marvin shi <marvin.shi@nokia.com>
Wed, 17 Nov 2010 14:05:07 +0800
changeset 691 9eeecb73a5d4
parent 600 6d08f4a05d93
permissions -rw-r--r--
fix ou1cimx1#651819
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
600
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     1
/*
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     2
 *
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     3
 * Copyright (c) 2004
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     4
 * John Maddock
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     5
 *
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     6
 * Use, modification and distribution are subject to the 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     7
 * Boost Software License, Version 1.0. (See accompanying file 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     8
 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     9
 *
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    10
 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    11
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    12
 /*
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    13
  *   LOCATION:    see http://www.boost.org for most recent version.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    14
  *   FILE         icu.hpp
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    15
  *   VERSION      see <boost/version.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    16
  *   DESCRIPTION: Unicode regular expressions on top of the ICU Library.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    17
  */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    18
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    19
#ifndef BOOST_REGEX_ICU_HPP
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    20
#define BOOST_REGEX_ICU_HPP
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    21
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    22
#include <unicode/utypes.h>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    23
#include <unicode/uchar.h>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    24
#include <unicode/coll.h>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    25
#include <boost/regex.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    26
#include <boost/regex/pending/unicode_iterator.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    27
#include <boost/mpl/int_fwd.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    28
#include <bitset>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    29
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    30
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    31
namespace boost{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    32
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    33
namespace re_detail{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    34
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    35
// 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    36
// Implementation details:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    37
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    38
class BOOST_REGEX_DECL icu_regex_traits_implementation
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    39
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    40
   typedef UChar32                      char_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    41
   typedef std::size_t                  size_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    42
   typedef std::vector<char_type>       string_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    43
   typedef U_NAMESPACE_QUALIFIER Locale locale_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    44
   typedef boost::uint_least32_t        char_class_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    45
public:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    46
   icu_regex_traits_implementation(const U_NAMESPACE_QUALIFIER Locale& l)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    47
      : m_locale(l)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    48
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    49
      UErrorCode success = U_ZERO_ERROR;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    50
      m_collator.reset(U_NAMESPACE_QUALIFIER Collator::createInstance(l, success));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    51
      if(U_SUCCESS(success) == 0)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    52
         init_error();
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    53
      m_collator->setStrength(U_NAMESPACE_QUALIFIER Collator::IDENTICAL);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    54
      success = U_ZERO_ERROR;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    55
      m_primary_collator.reset(U_NAMESPACE_QUALIFIER Collator::createInstance(l, success));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    56
      if(U_SUCCESS(success) == 0)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    57
         init_error();
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    58
      m_primary_collator->setStrength(U_NAMESPACE_QUALIFIER Collator::PRIMARY);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    59
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    60
   U_NAMESPACE_QUALIFIER Locale getloc()const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    61
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    62
      return m_locale;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    63
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    64
   string_type do_transform(const char_type* p1, const char_type* p2, const U_NAMESPACE_QUALIFIER Collator* pcoll) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    65
   string_type transform(const char_type* p1, const char_type* p2) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    66
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    67
      return do_transform(p1, p2, m_collator.get());
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    68
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    69
   string_type transform_primary(const char_type* p1, const char_type* p2) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    70
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    71
      return do_transform(p1, p2, m_primary_collator.get());
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    72
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    73
private:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    74
   void init_error()
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    75
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    76
      std::runtime_error e("Could not initialize ICU resources");
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    77
      boost::throw_exception(e);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    78
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    79
   U_NAMESPACE_QUALIFIER Locale m_locale;                                  // The ICU locale that we're using
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    80
   boost::scoped_ptr< U_NAMESPACE_QUALIFIER Collator> m_collator;          // The full collation object
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    81
   boost::scoped_ptr< U_NAMESPACE_QUALIFIER Collator> m_primary_collator;  // The primary collation object
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    82
};
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    83
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    84
inline boost::shared_ptr<icu_regex_traits_implementation> get_icu_regex_traits_implementation(const U_NAMESPACE_QUALIFIER Locale& loc)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    85
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    86
   return boost::shared_ptr<icu_regex_traits_implementation>(new icu_regex_traits_implementation(loc));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    87
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    88
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    89
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    90
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    91
class BOOST_REGEX_DECL icu_regex_traits
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    92
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    93
public:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    94
   typedef UChar32                      char_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    95
   typedef std::size_t                  size_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    96
   typedef std::vector<char_type>       string_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    97
   typedef U_NAMESPACE_QUALIFIER Locale locale_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    98
#ifdef BOOST_NO_INT64_T
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    99
   typedef std::bitset<64>              char_class_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   100
#else
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   101
   typedef boost::uint64_t              char_class_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   102
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   103
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   104
   struct boost_extensions_tag{};
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   105
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   106
   icu_regex_traits()
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   107
      : m_pimpl(re_detail::get_icu_regex_traits_implementation(U_NAMESPACE_QUALIFIER Locale()))
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   108
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   109
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   110
   static size_type length(const char_type* p);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   111
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   112
   ::boost::regex_constants::syntax_type syntax_type(char_type c)const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   113
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   114
      return ((c < 0x7f) && (c > 0)) ? re_detail::get_default_syntax_type(static_cast<char>(c)) : regex_constants::syntax_char;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   115
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   116
   ::boost::regex_constants::escape_syntax_type escape_syntax_type(char_type c) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   117
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   118
      return ((c < 0x7f) && (c > 0)) ? re_detail::get_default_escape_syntax_type(static_cast<char>(c)) : regex_constants::syntax_char;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   119
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   120
   char_type translate(char_type c) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   121
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   122
      return c;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   123
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   124
   char_type translate_nocase(char_type c) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   125
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   126
      return ::u_tolower(c);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   127
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   128
   char_type translate(char_type c, bool icase) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   129
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   130
      return icase ? translate_nocase(c) : translate(c);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   131
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   132
   char_type tolower(char_type c) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   133
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   134
      return ::u_tolower(c);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   135
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   136
   char_type toupper(char_type c) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   137
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   138
      return ::u_toupper(c);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   139
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   140
   string_type transform(const char_type* p1, const char_type* p2) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   141
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   142
      return m_pimpl->transform(p1, p2);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   143
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   144
   string_type transform_primary(const char_type* p1, const char_type* p2) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   145
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   146
      return m_pimpl->transform_primary(p1, p2);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   147
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   148
   char_class_type lookup_classname(const char_type* p1, const char_type* p2) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   149
   string_type lookup_collatename(const char_type* p1, const char_type* p2) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   150
   bool isctype(char_type c, char_class_type f) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   151
   int toi(const char_type*& p1, const char_type* p2, int radix)const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   152
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   153
      return re_detail::global_toi(p1, p2, radix, *this);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   154
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   155
   int value(char_type c, int radix)const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   156
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   157
      return u_digit(c, static_cast< ::int8_t>(radix));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   158
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   159
   locale_type imbue(locale_type l)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   160
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   161
      locale_type result(m_pimpl->getloc());
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   162
      m_pimpl = re_detail::get_icu_regex_traits_implementation(l);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   163
      return result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   164
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   165
   locale_type getloc()const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   166
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   167
      return locale_type();
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   168
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   169
   std::string error_string(::boost::regex_constants::error_type n) const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   170
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   171
      return re_detail::get_default_error_string(n);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   172
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   173
private:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   174
   icu_regex_traits(const icu_regex_traits&);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   175
   icu_regex_traits& operator=(const icu_regex_traits&);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   176
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   177
   //
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   178
   // define the bitmasks offsets we need for additional character properties:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   179
   //
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   180
   enum{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   181
      offset_blank = U_CHAR_CATEGORY_COUNT,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   182
      offset_space = U_CHAR_CATEGORY_COUNT+1,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   183
      offset_xdigit = U_CHAR_CATEGORY_COUNT+2,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   184
      offset_underscore = U_CHAR_CATEGORY_COUNT+3,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   185
      offset_unicode = U_CHAR_CATEGORY_COUNT+4,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   186
      offset_any = U_CHAR_CATEGORY_COUNT+5,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   187
      offset_ascii = U_CHAR_CATEGORY_COUNT+6
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   188
   };
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   189
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   190
   //
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   191
   // and now the masks:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   192
   //
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   193
   static const char_class_type mask_blank;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   194
   static const char_class_type mask_space;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   195
   static const char_class_type mask_xdigit;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   196
   static const char_class_type mask_underscore;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   197
   static const char_class_type mask_unicode;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   198
   static const char_class_type mask_any;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   199
   static const char_class_type mask_ascii;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   200
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   201
   static char_class_type lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   202
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   203
   boost::shared_ptr< ::boost::re_detail::icu_regex_traits_implementation> m_pimpl;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   204
};
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   205
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   206
} // namespace boost
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   207
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   208
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   209
// template instances:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   210
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   211
#define BOOST_REGEX_CHAR_T UChar32
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   212
#undef BOOST_REGEX_TRAITS_T
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   213
#define BOOST_REGEX_TRAITS_T , icu_regex_traits
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   214
#define BOOST_REGEX_ICU_INSTANCES
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   215
#ifdef BOOST_REGEX_ICU_INSTANTIATE
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   216
#  define BOOST_REGEX_INSTANTIATE
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   217
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   218
#include <boost/regex/v4/instances.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   219
#undef BOOST_REGEX_CHAR_T
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   220
#undef BOOST_REGEX_TRAITS_T
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   221
#undef BOOST_REGEX_ICU_INSTANCES
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   222
#ifdef BOOST_REGEX_INSTANTIATE
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   223
#  undef BOOST_REGEX_INSTANTIATE
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   224
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   225
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   226
namespace boost{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   227
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   228
// types:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   229
typedef basic_regex< ::UChar32, icu_regex_traits> u32regex;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   230
typedef match_results<const ::UChar32*> u32match;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   231
typedef match_results<const ::UChar*> u16match;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   232
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   233
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   234
// Construction of 32-bit regex types from UTF-8 and UTF-16 primitives:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   235
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   236
namespace re_detail{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   237
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   238
#if !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   239
template <class InputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   240
inline u32regex do_make_u32regex(InputIterator i, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   241
                              InputIterator j, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   242
                              boost::regex_constants::syntax_option_type opt, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   243
                              const boost::mpl::int_<1>*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   244
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   245
   typedef boost::u8_to_u32_iterator<InputIterator, UChar32> conv_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   246
   return u32regex(conv_type(i), conv_type(j), opt);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   247
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   248
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   249
template <class InputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   250
inline u32regex do_make_u32regex(InputIterator i, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   251
                              InputIterator j, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   252
                              boost::regex_constants::syntax_option_type opt, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   253
                              const boost::mpl::int_<2>*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   254
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   255
   typedef boost::u16_to_u32_iterator<InputIterator, UChar32> conv_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   256
   return u32regex(conv_type(i), conv_type(j), opt);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   257
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   258
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   259
template <class InputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   260
inline u32regex do_make_u32regex(InputIterator i, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   261
                              InputIterator j, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   262
                              boost::regex_constants::syntax_option_type opt, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   263
                              const boost::mpl::int_<4>*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   264
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   265
   return u32regex(i, j, opt);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   266
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   267
#else
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   268
template <class InputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   269
inline u32regex do_make_u32regex(InputIterator i, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   270
                              InputIterator j, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   271
                              boost::regex_constants::syntax_option_type opt, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   272
                              const boost::mpl::int_<1>*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   273
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   274
   typedef boost::u8_to_u32_iterator<InputIterator, UChar32> conv_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   275
   typedef std::vector<UChar32> vector_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   276
   vector_type v;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   277
   conv_type a(i), b(j);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   278
   while(a != b)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   279
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   280
      v.push_back(*a);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   281
      ++a;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   282
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   283
   if(v.size())
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   284
      return u32regex(&*v.begin(), v.size(), opt);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   285
   return u32regex(static_cast<UChar32 const*>(0), static_cast<u32regex::size_type>(0), opt);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   286
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   287
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   288
template <class InputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   289
inline u32regex do_make_u32regex(InputIterator i, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   290
                              InputIterator j, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   291
                              boost::regex_constants::syntax_option_type opt, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   292
                              const boost::mpl::int_<2>*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   293
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   294
   typedef boost::u16_to_u32_iterator<InputIterator, UChar32> conv_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   295
   typedef std::vector<UChar32> vector_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   296
   vector_type v;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   297
   conv_type a(i), b(j);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   298
   while(a != b)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   299
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   300
      v.push_back(*a);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   301
      ++a;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   302
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   303
   if(v.size())
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   304
      return u32regex(&*v.begin(), v.size(), opt);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   305
   return u32regex(static_cast<UChar32 const*>(0), static_cast<u32regex::size_type>(0), opt);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   306
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   307
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   308
template <class InputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   309
inline u32regex do_make_u32regex(InputIterator i, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   310
                              InputIterator j, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   311
                              boost::regex_constants::syntax_option_type opt, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   312
                              const boost::mpl::int_<4>*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   313
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   314
   typedef std::vector<UCHAR32> vector_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   315
   vector_type v;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   316
   while(i != j)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   317
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   318
      v.push_back((UCHAR32)(*i));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   319
      ++a;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   320
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   321
   if(v.size())
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   322
      return u32regex(&*v.begin(), v.size(), opt);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   323
   return u32regex(static_cast<UChar32 const*>(0), static_cast<u32regex::size_type>(0), opt);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   324
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   325
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   326
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   327
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   328
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   329
// Construction from an iterator pair:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   330
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   331
template <class InputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   332
inline u32regex make_u32regex(InputIterator i, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   333
                              InputIterator j, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   334
                              boost::regex_constants::syntax_option_type opt)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   335
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   336
   return re_detail::do_make_u32regex(i, j, opt, static_cast<boost::mpl::int_<sizeof(*i)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   337
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   338
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   339
// construction from UTF-8 nul-terminated strings:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   340
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   341
inline u32regex make_u32regex(const char* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   342
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   343
   return re_detail::do_make_u32regex(p, p + std::strlen(p), opt, static_cast<boost::mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   344
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   345
inline u32regex make_u32regex(const unsigned char* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   346
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   347
   return re_detail::do_make_u32regex(p, p + std::strlen(reinterpret_cast<const char*>(p)), opt, static_cast<boost::mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   348
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   349
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   350
// construction from UTF-16 nul-terminated strings:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   351
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   352
#ifndef BOOST_NO_WREGEX
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   353
inline u32regex make_u32regex(const wchar_t* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   354
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   355
   return re_detail::do_make_u32regex(p, p + std::wcslen(p), opt, static_cast<boost::mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   356
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   357
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   358
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   359
inline u32regex make_u32regex(const UChar* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   360
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   361
   return re_detail::do_make_u32regex(p, p + u_strlen(p), opt, static_cast<boost::mpl::int_<2> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   362
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   363
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   364
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   365
// construction from basic_string class-template:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   366
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   367
template<class C, class T, class A>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   368
inline u32regex make_u32regex(const std::basic_string<C, T, A>& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   369
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   370
   return re_detail::do_make_u32regex(s.begin(), s.end(), opt, static_cast<boost::mpl::int_<sizeof(C)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   371
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   372
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   373
// Construction from ICU string type:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   374
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   375
inline u32regex make_u32regex(const UnicodeString& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   376
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   377
   return re_detail::do_make_u32regex(s.getBuffer(), s.getBuffer() + s.length(), opt, static_cast<boost::mpl::int_<2> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   378
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   379
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   380
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   381
// regex_match overloads that widen the character type as appropriate:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   382
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   383
namespace re_detail{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   384
template<class MR1, class MR2>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   385
void copy_results(MR1& out, MR2 const& in)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   386
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   387
   // copy results from an adapted MR2 match_results:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   388
   out.set_size(in.size(), in.prefix().first.base(), in.suffix().second.base());
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   389
   out.set_base(in.base().base());
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   390
   for(int i = 0; i < (int)in.size(); ++i)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   391
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   392
      if(in[i].matched)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   393
      {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   394
         out.set_first(in[i].first.base(), i);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   395
         out.set_second(in[i].second.base(), i);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   396
      }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   397
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   398
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   399
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   400
template <class BidiIterator, class Allocator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   401
inline bool do_regex_match(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   402
                 match_results<BidiIterator, Allocator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   403
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   404
                 match_flag_type flags,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   405
                 boost::mpl::int_<4> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   406
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   407
   return ::boost::regex_match(first, last, m, e, flags);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   408
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   409
template <class BidiIterator, class Allocator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   410
bool do_regex_match(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   411
                 match_results<BidiIterator, Allocator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   412
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   413
                 match_flag_type flags,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   414
                 boost::mpl::int_<2> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   415
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   416
   typedef u16_to_u32_iterator<BidiIterator, UChar32> conv_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   417
   typedef match_results<conv_type>                   match_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   418
   typedef typename match_type::allocator_type        alloc_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   419
   match_type what;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   420
   bool result = ::boost::regex_match(conv_type(first), conv_type(last), what, e, flags);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   421
   // copy results across to m:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   422
   if(result) copy_results(m, what);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   423
   return result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   424
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   425
template <class BidiIterator, class Allocator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   426
bool do_regex_match(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   427
                 match_results<BidiIterator, Allocator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   428
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   429
                 match_flag_type flags,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   430
                 boost::mpl::int_<1> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   431
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   432
   typedef u8_to_u32_iterator<BidiIterator, UChar32>  conv_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   433
   typedef match_results<conv_type>                   match_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   434
   typedef typename match_type::allocator_type        alloc_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   435
   match_type what;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   436
   bool result = ::boost::regex_match(conv_type(first), conv_type(last), what, e, flags);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   437
   // copy results across to m:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   438
   if(result) copy_results(m, what);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   439
   return result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   440
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   441
} // namespace re_detail
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   442
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   443
template <class BidiIterator, class Allocator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   444
inline bool u32regex_match(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   445
                 match_results<BidiIterator, Allocator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   446
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   447
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   448
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   449
   return re_detail::do_regex_match(first, last, m, e, flags, static_cast<mpl::int_<sizeof(*first)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   450
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   451
inline bool u32regex_match(const UChar* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   452
                 match_results<const UChar*>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   453
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   454
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   455
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   456
   return re_detail::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast<mpl::int_<2> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   457
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   458
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   459
inline bool u32regex_match(const wchar_t* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   460
                 match_results<const wchar_t*>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   461
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   462
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   463
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   464
   return re_detail::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   465
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   466
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   467
inline bool u32regex_match(const char* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   468
                 match_results<const char*>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   469
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   470
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   471
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   472
   return re_detail::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   473
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   474
inline bool u32regex_match(const unsigned char* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   475
                 match_results<const unsigned char*>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   476
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   477
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   478
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   479
   return re_detail::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   480
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   481
inline bool u32regex_match(const std::string& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   482
                        match_results<std::string::const_iterator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   483
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   484
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   485
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   486
   return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   487
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   488
#ifndef BOOST_NO_STD_WSTRING
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   489
inline bool u32regex_match(const std::wstring& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   490
                        match_results<std::wstring::const_iterator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   491
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   492
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   493
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   494
   return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   495
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   496
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   497
inline bool u32regex_match(const UnicodeString& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   498
                        match_results<const UChar*>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   499
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   500
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   501
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   502
   return re_detail::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   503
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   504
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   505
// regex_match overloads that do not return what matched:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   506
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   507
template <class BidiIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   508
inline bool u32regex_match(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   509
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   510
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   511
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   512
   match_results<BidiIterator> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   513
   return re_detail::do_regex_match(first, last, m, e, flags, static_cast<mpl::int_<sizeof(*first)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   514
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   515
inline bool u32regex_match(const UChar* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   516
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   517
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   518
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   519
   match_results<const UChar*> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   520
   return re_detail::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast<mpl::int_<2> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   521
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   522
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   523
inline bool u32regex_match(const wchar_t* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   524
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   525
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   526
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   527
   match_results<const wchar_t*> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   528
   return re_detail::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   529
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   530
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   531
inline bool u32regex_match(const char* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   532
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   533
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   534
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   535
   match_results<const char*> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   536
   return re_detail::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   537
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   538
inline bool u32regex_match(const unsigned char* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   539
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   540
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   541
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   542
   match_results<const unsigned char*> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   543
   return re_detail::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   544
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   545
inline bool u32regex_match(const std::string& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   546
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   547
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   548
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   549
   match_results<std::string::const_iterator> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   550
   return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   551
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   552
#ifndef BOOST_NO_STD_WSTRING
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   553
inline bool u32regex_match(const std::wstring& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   554
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   555
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   556
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   557
   match_results<std::wstring::const_iterator> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   558
   return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   559
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   560
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   561
inline bool u32regex_match(const UnicodeString& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   562
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   563
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   564
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   565
   match_results<const UChar*> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   566
   return re_detail::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   567
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   568
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   569
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   570
// regex_search overloads that widen the character type as appropriate:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   571
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   572
namespace re_detail{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   573
template <class BidiIterator, class Allocator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   574
inline bool do_regex_search(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   575
                 match_results<BidiIterator, Allocator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   576
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   577
                 match_flag_type flags,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   578
                 BidiIterator base,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   579
                 boost::mpl::int_<4> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   580
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   581
   return ::boost::regex_search(first, last, m, e, flags, base);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   582
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   583
template <class BidiIterator, class Allocator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   584
bool do_regex_search(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   585
                 match_results<BidiIterator, Allocator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   586
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   587
                 match_flag_type flags,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   588
                 BidiIterator base,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   589
                 boost::mpl::int_<2> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   590
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   591
   typedef u16_to_u32_iterator<BidiIterator, UChar32> conv_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   592
   typedef match_results<conv_type>                   match_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   593
   typedef typename match_type::allocator_type        alloc_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   594
   match_type what;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   595
   bool result = ::boost::regex_search(conv_type(first), conv_type(last), what, e, flags, conv_type(base));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   596
   // copy results across to m:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   597
   if(result) copy_results(m, what);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   598
   return result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   599
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   600
template <class BidiIterator, class Allocator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   601
bool do_regex_search(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   602
                 match_results<BidiIterator, Allocator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   603
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   604
                 match_flag_type flags,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   605
                 BidiIterator base,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   606
                 boost::mpl::int_<1> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   607
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   608
   typedef u8_to_u32_iterator<BidiIterator, UChar32>  conv_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   609
   typedef match_results<conv_type>                   match_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   610
   typedef typename match_type::allocator_type        alloc_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   611
   match_type what;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   612
   bool result = ::boost::regex_search(conv_type(first), conv_type(last), what, e, flags, conv_type(base));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   613
   // copy results across to m:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   614
   if(result) copy_results(m, what);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   615
   return result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   616
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   617
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   618
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   619
template <class BidiIterator, class Allocator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   620
inline bool u32regex_search(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   621
                 match_results<BidiIterator, Allocator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   622
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   623
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   624
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   625
   return re_detail::do_regex_search(first, last, m, e, flags, first, static_cast<mpl::int_<sizeof(*first)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   626
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   627
template <class BidiIterator, class Allocator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   628
inline bool u32regex_search(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   629
                 match_results<BidiIterator, Allocator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   630
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   631
                 match_flag_type flags,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   632
                 BidiIterator base)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   633
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   634
   return re_detail::do_regex_search(first, last, m, e, flags, base, static_cast<mpl::int_<sizeof(*first)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   635
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   636
inline bool u32regex_search(const UChar* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   637
                 match_results<const UChar*>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   638
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   639
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   640
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   641
   return re_detail::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast<mpl::int_<2> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   642
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   643
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   644
inline bool u32regex_search(const wchar_t* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   645
                 match_results<const wchar_t*>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   646
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   647
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   648
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   649
   return re_detail::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   650
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   651
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   652
inline bool u32regex_search(const char* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   653
                 match_results<const char*>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   654
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   655
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   656
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   657
   return re_detail::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   658
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   659
inline bool u32regex_search(const unsigned char* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   660
                 match_results<const unsigned char*>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   661
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   662
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   663
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   664
   return re_detail::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   665
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   666
inline bool u32regex_search(const std::string& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   667
                        match_results<std::string::const_iterator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   668
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   669
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   670
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   671
   return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   672
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   673
#ifndef BOOST_NO_STD_WSTRING
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   674
inline bool u32regex_search(const std::wstring& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   675
                        match_results<std::wstring::const_iterator>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   676
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   677
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   678
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   679
   return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   680
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   681
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   682
inline bool u32regex_search(const UnicodeString& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   683
                        match_results<const UChar*>& m, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   684
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   685
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   686
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   687
   return re_detail::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   688
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   689
template <class BidiIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   690
inline bool u32regex_search(BidiIterator first, BidiIterator last, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   691
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   692
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   693
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   694
   match_results<BidiIterator> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   695
   return re_detail::do_regex_search(first, last, m, e, flags, first, static_cast<mpl::int_<sizeof(*first)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   696
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   697
inline bool u32regex_search(const UChar* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   698
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   699
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   700
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   701
   match_results<const UChar*> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   702
   return re_detail::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast<mpl::int_<2> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   703
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   704
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   705
inline bool u32regex_search(const wchar_t* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   706
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   707
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   708
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   709
   match_results<const wchar_t*> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   710
   return re_detail::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   711
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   712
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   713
inline bool u32regex_search(const char* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   714
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   715
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   716
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   717
   match_results<const char*> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   718
   return re_detail::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   719
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   720
inline bool u32regex_search(const unsigned char* p, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   721
                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   722
                 match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   723
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   724
   match_results<const unsigned char*> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   725
   return re_detail::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   726
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   727
inline bool u32regex_search(const std::string& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   728
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   729
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   730
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   731
   match_results<std::string::const_iterator> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   732
   return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<1> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   733
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   734
#ifndef BOOST_NO_STD_WSTRING
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   735
inline bool u32regex_search(const std::wstring& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   736
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   737
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   738
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   739
   match_results<std::wstring::const_iterator> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   740
   return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   741
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   742
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   743
inline bool u32regex_search(const UnicodeString& s, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   744
                        const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   745
                        match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   746
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   747
   match_results<const UChar*> m;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   748
   return re_detail::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   749
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   750
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   751
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   752
// overloads for regex_replace with utf-8 and utf-16 data types:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   753
//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   754
namespace re_detail{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   755
template <class I>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   756
inline std::pair< boost::u8_to_u32_iterator<I>, boost::u8_to_u32_iterator<I> >
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   757
   make_utf32_seq(I i, I j, mpl::int_<1> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   758
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   759
   return std::pair< boost::u8_to_u32_iterator<I>, boost::u8_to_u32_iterator<I> >(boost::u8_to_u32_iterator<I>(i), boost::u8_to_u32_iterator<I>(j));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   760
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   761
template <class I>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   762
inline std::pair< boost::u16_to_u32_iterator<I>, boost::u16_to_u32_iterator<I> >
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   763
   make_utf32_seq(I i, I j, mpl::int_<2> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   764
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   765
   return std::pair< boost::u16_to_u32_iterator<I>, boost::u16_to_u32_iterator<I> >(boost::u16_to_u32_iterator<I>(i), boost::u16_to_u32_iterator<I>(j));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   766
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   767
template <class I>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   768
inline std::pair< I, I >
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   769
   make_utf32_seq(I i, I j, mpl::int_<4> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   770
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   771
   return std::pair< I, I >(i, j);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   772
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   773
template <class charT>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   774
inline std::pair< boost::u8_to_u32_iterator<const charT*>, boost::u8_to_u32_iterator<const charT*> >
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   775
   make_utf32_seq(const charT* p, mpl::int_<1> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   776
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   777
   return std::pair< boost::u8_to_u32_iterator<const charT*>, boost::u8_to_u32_iterator<const charT*> >(boost::u8_to_u32_iterator<const charT*>(p), boost::u8_to_u32_iterator<const charT*>(p+std::strlen((const char*)p)));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   778
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   779
template <class charT>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   780
inline std::pair< boost::u16_to_u32_iterator<const charT*>, boost::u16_to_u32_iterator<const charT*> >
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   781
   make_utf32_seq(const charT* p, mpl::int_<2> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   782
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   783
   return std::pair< boost::u16_to_u32_iterator<const charT*>, boost::u16_to_u32_iterator<const charT*> >(boost::u16_to_u32_iterator<const charT*>(p), boost::u16_to_u32_iterator<const charT*>(p+u_strlen((const UChar*)p)));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   784
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   785
template <class charT>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   786
inline std::pair< const charT*, const charT* >
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   787
   make_utf32_seq(const charT* p, mpl::int_<4> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   788
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   789
   return std::pair< const charT*, const charT* >(p, p+icu_regex_traits::length((UChar32 const*)p));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   790
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   791
template <class OutputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   792
inline OutputIterator make_utf32_out(OutputIterator o, mpl::int_<4> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   793
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   794
   return o;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   795
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   796
template <class OutputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   797
inline utf16_output_iterator<OutputIterator> make_utf32_out(OutputIterator o, mpl::int_<2> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   798
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   799
   return o;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   800
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   801
template <class OutputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   802
inline utf8_output_iterator<OutputIterator> make_utf32_out(OutputIterator o, mpl::int_<1> const*)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   803
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   804
   return o;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   805
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   806
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   807
template <class OutputIterator, class I1, class I2>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   808
OutputIterator do_regex_replace(OutputIterator out,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   809
                                 std::pair<I1, I1> const& in,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   810
                                 const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   811
                                 const std::pair<I2, I2>& fmt, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   812
                                 match_flag_type flags
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   813
                                 )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   814
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   815
   // unfortunately we have to copy the format string in order to pass in onward:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   816
   std::vector<UChar32> f;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   817
#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   818
   f.assign(fmt.first, fmt.second);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   819
#else
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   820
   f.clear();
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   821
   I2 pos = fmt.first;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   822
   while(pos != fmt.second)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   823
      f.push_back(*pos++);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   824
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   825
   
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   826
   regex_iterator<I1, UChar32, icu_regex_traits> i(in.first, in.second, e, flags);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   827
   regex_iterator<I1, UChar32, icu_regex_traits> j;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   828
   if(i == j)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   829
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   830
      if(!(flags & regex_constants::format_no_copy))
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   831
         out = re_detail::copy(in.first, in.second, out);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   832
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   833
   else
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   834
   {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   835
      I1 last_m = in.first;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   836
      while(i != j)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   837
      {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   838
         if(!(flags & regex_constants::format_no_copy))
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   839
            out = re_detail::copy(i->prefix().first, i->prefix().second, out); 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   840
         if(f.size())
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   841
            out = ::boost::re_detail::regex_format_imp(out, *i, &*f.begin(), &*f.begin() + f.size(), flags, e.get_traits());
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   842
         else
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   843
            out = ::boost::re_detail::regex_format_imp(out, *i, static_cast<UChar32 const*>(0), static_cast<UChar32 const*>(0), flags, e.get_traits());
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   844
         last_m = (*i)[0].second;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   845
         if(flags & regex_constants::format_first_only)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   846
            break;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   847
         ++i;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   848
      }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   849
      if(!(flags & regex_constants::format_no_copy))
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   850
         out = re_detail::copy(last_m, in.second, out);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   851
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   852
   return out;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   853
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   854
template <class BaseIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   855
inline const BaseIterator& extract_output_base(const BaseIterator& b)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   856
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   857
   return b;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   858
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   859
template <class BaseIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   860
inline BaseIterator extract_output_base(const utf8_output_iterator<BaseIterator>& b)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   861
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   862
   return b.base();
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   863
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   864
template <class BaseIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   865
inline BaseIterator extract_output_base(const utf16_output_iterator<BaseIterator>& b)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   866
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   867
   return b.base();
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   868
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   869
}  // re_detail
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   870
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   871
template <class OutputIterator, class BidirectionalIterator, class charT>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   872
inline OutputIterator u32regex_replace(OutputIterator out,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   873
                         BidirectionalIterator first,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   874
                         BidirectionalIterator last,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   875
                         const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   876
                         const charT* fmt, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   877
                         match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   878
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   879
   return re_detail::extract_output_base
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   880
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   881
   <OutputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   882
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   883
    (
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   884
      re_detail::do_regex_replace(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   885
         re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   886
         re_detail::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   887
         e,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   888
         re_detail::make_utf32_seq(fmt, static_cast<mpl::int_<sizeof(*fmt)> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   889
         flags)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   890
      );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   891
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   892
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   893
template <class OutputIterator, class Iterator, class charT>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   894
inline OutputIterator u32regex_replace(OutputIterator out,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   895
                         Iterator first,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   896
                         Iterator last,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   897
                         const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   898
                         const std::basic_string<charT>& fmt,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   899
                         match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   900
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   901
   return re_detail::extract_output_base
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   902
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   903
   <OutputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   904
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   905
    (
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   906
      re_detail::do_regex_replace(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   907
         re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   908
         re_detail::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   909
         e,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   910
         re_detail::make_utf32_seq(fmt.begin(), fmt.end(), static_cast<mpl::int_<sizeof(charT)> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   911
         flags)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   912
      );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   913
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   914
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   915
template <class OutputIterator, class Iterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   916
inline OutputIterator u32regex_replace(OutputIterator out,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   917
                         Iterator first,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   918
                         Iterator last,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   919
                         const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   920
                         const UnicodeString& fmt,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   921
                         match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   922
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   923
   return re_detail::extract_output_base
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   924
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   925
   <OutputIterator>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   926
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   927
   (
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   928
      re_detail::do_regex_replace(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   929
         re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   930
         re_detail::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   931
         e,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   932
         re_detail::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   933
         flags)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   934
      );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   935
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   936
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   937
template <class charT>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   938
std::basic_string<charT> u32regex_replace(const std::basic_string<charT>& s,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   939
                         const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   940
                         const charT* fmt,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   941
                         match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   942
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   943
   std::basic_string<charT> result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   944
   re_detail::string_out_iterator<std::basic_string<charT> > i(result);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   945
   u32regex_replace(i, s.begin(), s.end(), e, fmt, flags);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   946
   return result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   947
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   948
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   949
template <class charT>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   950
std::basic_string<charT> u32regex_replace(const std::basic_string<charT>& s,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   951
                         const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   952
                         const std::basic_string<charT>& fmt,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   953
                         match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   954
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   955
   std::basic_string<charT> result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   956
   re_detail::string_out_iterator<std::basic_string<charT> > i(result);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   957
   u32regex_replace(i, s.begin(), s.end(), e, fmt.c_str(), flags);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   958
   return result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   959
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   960
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   961
namespace re_detail{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   962
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   963
class unicode_string_out_iterator
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   964
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   965
   UnicodeString* out;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   966
public:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   967
   unicode_string_out_iterator(UnicodeString& s) : out(&s) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   968
   unicode_string_out_iterator& operator++() { return *this; }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   969
   unicode_string_out_iterator& operator++(int) { return *this; }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   970
   unicode_string_out_iterator& operator*() { return *this; }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   971
   unicode_string_out_iterator& operator=(UChar v) 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   972
   { 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   973
      *out += v; 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   974
      return *this; 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   975
   }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   976
   typedef std::ptrdiff_t difference_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   977
   typedef UChar value_type;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   978
   typedef value_type* pointer;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   979
   typedef value_type& reference;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   980
   typedef std::output_iterator_tag iterator_category;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   981
};
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   982
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   983
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   984
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   985
inline UnicodeString u32regex_replace(const UnicodeString& s,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   986
                         const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   987
                         const UChar* fmt,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   988
                         match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   989
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   990
   UnicodeString result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   991
   re_detail::unicode_string_out_iterator i(result);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   992
   u32regex_replace(i, s.getBuffer(), s.getBuffer()+s.length(), e, fmt, flags);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   993
   return result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   994
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   995
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   996
inline UnicodeString u32regex_replace(const UnicodeString& s,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   997
                         const u32regex& e, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   998
                         const UnicodeString& fmt,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   999
                         match_flag_type flags = match_default)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1000
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1001
   UnicodeString result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1002
   re_detail::unicode_string_out_iterator i(result);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1003
   re_detail::do_regex_replace(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1004
         re_detail::make_utf32_out(i, static_cast<mpl::int_<2> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1005
         re_detail::make_utf32_seq(s.getBuffer(), s.getBuffer()+s.length(), static_cast<mpl::int_<2> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1006
         e,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1007
         re_detail::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1008
         flags);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1009
   return result;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1010
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1011
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1012
} // namespace boost.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1013
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1014
#include <boost/regex/v4/u32regex_iterator.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1015
#include <boost/regex/v4/u32regex_token_iterator.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1016
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
  1017
#endif