passenger 4.0.27 → 4.0.28

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (156) hide show
  1. data.tar.gz.asc +7 -7
  2. data/.gitignore +1 -0
  3. data/NEWS +22 -0
  4. data/build/preprocessor.rb +10 -0
  5. data/build/rpm.rb +74 -65
  6. data/debian.template/rules.template +8 -0
  7. data/dev/copy_boost_headers.rb +11 -2
  8. data/doc/Users guide Apache.idmap.txt +161 -145
  9. data/doc/Users guide Apache.txt +12 -1
  10. data/doc/Users guide Nginx.idmap.txt +142 -126
  11. data/doc/Users guide Nginx.txt +14 -1
  12. data/doc/Users guide Standalone.txt +1 -0
  13. data/doc/users_guide_snippets/environment_variables.txt +1 -1
  14. data/doc/users_guide_snippets/installation.txt +2 -0
  15. data/doc/users_guide_snippets/tips.txt +118 -0
  16. data/ext/apache2/Configuration.cpp +0 -6
  17. data/ext/apache2/Configuration.hpp +0 -5
  18. data/ext/apache2/ConfigurationCommands.cpp +7 -0
  19. data/ext/apache2/ConfigurationFields.hpp +2 -0
  20. data/ext/apache2/ConfigurationSetters.cpp +24 -0
  21. data/ext/apache2/CreateDirConfig.cpp +1 -0
  22. data/ext/apache2/Hooks.cpp +0 -1
  23. data/ext/apache2/MergeDirConfig.cpp +7 -0
  24. data/ext/apache2/SetHeaders.cpp +5 -1
  25. data/ext/boost/cregex.hpp +39 -0
  26. data/ext/boost/libs/regex/src/c_regex_traits.cpp +193 -0
  27. data/ext/boost/libs/regex/src/cpp_regex_traits.cpp +117 -0
  28. data/ext/boost/libs/regex/src/cregex.cpp +660 -0
  29. data/ext/boost/libs/regex/src/instances.cpp +32 -0
  30. data/ext/boost/libs/regex/src/internals.hpp +35 -0
  31. data/ext/boost/libs/regex/src/posix_api.cpp +296 -0
  32. data/ext/boost/libs/regex/src/regex.cpp +227 -0
  33. data/ext/boost/libs/regex/src/regex_debug.cpp +59 -0
  34. data/ext/boost/libs/regex/src/regex_raw_buffer.cpp +72 -0
  35. data/ext/boost/libs/regex/src/regex_traits_defaults.cpp +692 -0
  36. data/ext/boost/libs/regex/src/static_mutex.cpp +179 -0
  37. data/ext/boost/libs/regex/src/wc_regex_traits.cpp +301 -0
  38. data/ext/boost/libs/regex/src/wide_posix_api.cpp +315 -0
  39. data/ext/boost/libs/regex/src/winstances.cpp +35 -0
  40. data/ext/boost/regex.h +100 -0
  41. data/ext/boost/regex.hpp +37 -0
  42. data/ext/boost/regex/concepts.hpp +1128 -0
  43. data/ext/boost/regex/config.hpp +435 -0
  44. data/ext/boost/regex/config/borland.hpp +72 -0
  45. data/ext/boost/regex/config/cwchar.hpp +207 -0
  46. data/ext/boost/regex/mfc.hpp +190 -0
  47. data/ext/boost/regex/pattern_except.hpp +100 -0
  48. data/ext/boost/regex/pending/object_cache.hpp +165 -0
  49. data/ext/boost/regex/pending/static_mutex.hpp +179 -0
  50. data/ext/boost/regex/pending/unicode_iterator.hpp +776 -0
  51. data/ext/boost/regex/regex_traits.hpp +35 -0
  52. data/ext/boost/regex/user.hpp +93 -0
  53. data/ext/boost/regex/v4/basic_regex.hpp +782 -0
  54. data/ext/boost/regex/v4/basic_regex_creator.hpp +1571 -0
  55. data/ext/boost/regex/v4/basic_regex_parser.hpp +2874 -0
  56. data/ext/boost/regex/v4/c_regex_traits.hpp +211 -0
  57. data/ext/boost/regex/v4/char_regex_traits.hpp +81 -0
  58. data/ext/boost/regex/v4/cpp_regex_traits.hpp +1099 -0
  59. data/ext/boost/regex/v4/cregex.hpp +330 -0
  60. data/ext/boost/regex/v4/error_type.hpp +59 -0
  61. data/ext/boost/regex/v4/fileiter.hpp +455 -0
  62. data/ext/boost/regex/v4/instances.hpp +222 -0
  63. data/ext/boost/regex/v4/iterator_category.hpp +91 -0
  64. data/ext/boost/regex/v4/iterator_traits.hpp +135 -0
  65. data/ext/boost/regex/v4/match_flags.hpp +138 -0
  66. data/ext/boost/regex/v4/match_results.hpp +702 -0
  67. data/ext/boost/regex/v4/mem_block_cache.hpp +99 -0
  68. data/ext/boost/regex/v4/perl_matcher.hpp +587 -0
  69. data/ext/boost/regex/v4/perl_matcher_common.hpp +996 -0
  70. data/ext/boost/regex/v4/perl_matcher_non_recursive.hpp +1642 -0
  71. data/ext/boost/regex/v4/perl_matcher_recursive.hpp +991 -0
  72. data/ext/boost/regex/v4/primary_transform.hpp +146 -0
  73. data/ext/boost/regex/v4/protected_call.hpp +81 -0
  74. data/ext/boost/regex/v4/regbase.hpp +180 -0
  75. data/ext/boost/regex/v4/regex.hpp +202 -0
  76. data/ext/boost/regex/v4/regex_format.hpp +1156 -0
  77. data/ext/boost/regex/v4/regex_fwd.hpp +73 -0
  78. data/ext/boost/regex/v4/regex_grep.hpp +155 -0
  79. data/ext/boost/regex/v4/regex_iterator.hpp +201 -0
  80. data/ext/boost/regex/v4/regex_match.hpp +382 -0
  81. data/ext/boost/regex/v4/regex_merge.hpp +93 -0
  82. data/ext/boost/regex/v4/regex_raw_buffer.hpp +210 -0
  83. data/ext/boost/regex/v4/regex_replace.hpp +99 -0
  84. data/ext/boost/regex/v4/regex_search.hpp +217 -0
  85. data/ext/boost/regex/v4/regex_split.hpp +172 -0
  86. data/ext/boost/regex/v4/regex_token_iterator.hpp +342 -0
  87. data/ext/boost/regex/v4/regex_traits.hpp +189 -0
  88. data/ext/boost/regex/v4/regex_traits_defaults.hpp +371 -0
  89. data/ext/boost/regex/v4/regex_workaround.hpp +232 -0
  90. data/ext/boost/regex/v4/states.hpp +301 -0
  91. data/ext/boost/regex/v4/sub_match.hpp +512 -0
  92. data/ext/boost/regex/v4/syntax_type.hpp +105 -0
  93. data/ext/boost/regex/v4/u32regex_iterator.hpp +193 -0
  94. data/ext/boost/regex/v4/u32regex_token_iterator.hpp +377 -0
  95. data/ext/boost/regex/v4/w32_regex_traits.hpp +741 -0
  96. data/ext/boost/regex_fwd.hpp +33 -0
  97. data/ext/common/AgentsStarter.h +0 -11
  98. data/ext/common/ApplicationPool2/Common.h +1 -7
  99. data/ext/common/ApplicationPool2/DirectSpawner.h +3 -3
  100. data/ext/common/ApplicationPool2/Group.h +166 -69
  101. data/ext/common/ApplicationPool2/Implementation.cpp +55 -10
  102. data/ext/common/ApplicationPool2/Options.h +45 -10
  103. data/ext/common/ApplicationPool2/PipeWatcher.h +1 -2
  104. data/ext/common/ApplicationPool2/Pool.h +29 -7
  105. data/ext/common/ApplicationPool2/Process.h +22 -3
  106. data/ext/common/ApplicationPool2/Session.h +1 -0
  107. data/ext/common/ApplicationPool2/SmartSpawner.h +5 -10
  108. data/ext/common/ApplicationPool2/Spawner.h +10 -15
  109. data/ext/common/ApplicationPool2/SuperGroup.h +10 -9
  110. data/ext/common/Constants.h +1 -3
  111. data/ext/common/Hooks.h +193 -0
  112. data/ext/common/Logging.cpp +67 -2
  113. data/ext/common/Logging.h +23 -1
  114. data/ext/common/Utils.cpp +0 -21
  115. data/ext/common/Utils.h +0 -42
  116. data/ext/common/Utils/CachedFileStat.hpp +1 -1
  117. data/ext/common/Utils/StrIntUtils.h +61 -14
  118. data/ext/common/Utils/StringMap.h +4 -0
  119. data/ext/common/agents/HelperAgent/AgentOptions.h +4 -4
  120. data/ext/common/agents/HelperAgent/Main.cpp +2 -3
  121. data/ext/common/agents/HelperAgent/RequestHandler.h +65 -2
  122. data/ext/common/agents/LoggingAgent/FilterSupport.h +3 -1
  123. data/ext/common/agents/Watchdog/Main.cpp +8 -72
  124. data/ext/nginx/CacheLocationConfig.c +29 -1
  125. data/ext/nginx/Configuration.c +0 -12
  126. data/ext/nginx/Configuration.h +0 -1
  127. data/ext/nginx/ConfigurationCommands.c +10 -0
  128. data/ext/nginx/ConfigurationFields.h +2 -0
  129. data/ext/nginx/CreateLocationConfig.c +4 -0
  130. data/ext/nginx/MergeLocationConfig.c +6 -0
  131. data/ext/oxt/system_calls.cpp +7 -1
  132. data/ext/oxt/system_calls.hpp +7 -7
  133. data/helper-scripts/node-loader.js +6 -2
  134. data/helper-scripts/rack-loader.rb +5 -2
  135. data/helper-scripts/rack-preloader.rb +5 -2
  136. data/lib/phusion_passenger.rb +1 -1
  137. data/lib/phusion_passenger/apache2/config_options.rb +8 -0
  138. data/lib/phusion_passenger/constants.rb +0 -1
  139. data/lib/phusion_passenger/nginx/config_options.rb +9 -2
  140. data/lib/phusion_passenger/platform_info/apache.rb +2 -1
  141. data/lib/phusion_passenger/platform_info/compiler.rb +15 -1
  142. data/lib/phusion_passenger/platform_info/cxx_portability.rb +2 -0
  143. data/node_lib/phusion_passenger/httplib_emulation.js +85 -17
  144. data/node_lib/phusion_passenger/request_handler.js +10 -2
  145. data/rpm/Vagrantfile +32 -0
  146. data/rpm/get_distro_id.py +4 -0
  147. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +2 -2
  148. data/test/cxx/ApplicationPool2/PoolTest.cpp +60 -9
  149. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +2 -6
  150. data/test/cxx/CachedFileStatTest.cpp +5 -5
  151. data/test/cxx/RequestHandlerTest.cpp +3 -6
  152. data/test/cxx/UtilsTest.cpp +30 -0
  153. data/test/node/httplib_emulation_spec.js +491 -0
  154. data/test/node/spec_helper.js +25 -0
  155. metadata +78 -2
  156. metadata.gz.asc +7 -7
@@ -0,0 +1,207 @@
1
+ /*
2
+ *
3
+ * Copyright (c) 1998-2002
4
+ * John Maddock
5
+ *
6
+ * Use, modification and distribution are subject to the
7
+ * Boost Software License, Version 1.0. (See accompanying file
8
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9
+ *
10
+ */
11
+
12
+ /*
13
+ * LOCATION: see http://www.boost.org for most recent version.
14
+ * FILE boost/regex/config/cwchar.hpp
15
+ * VERSION see <boost/version.hpp>
16
+ * DESCRIPTION: regex wide character string fixes.
17
+ */
18
+
19
+ #ifndef BOOST_REGEX_CONFIG_CWCHAR_HPP
20
+ #define BOOST_REGEX_CONFIG_CWCHAR_HPP
21
+
22
+ #include <cwchar>
23
+ #include <cwctype>
24
+ #include <boost/config.hpp>
25
+
26
+ #if defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
27
+ // apparently this is required for the RW STL on Linux:
28
+ #undef iswalnum
29
+ #undef iswalpha
30
+ #undef iswblank
31
+ #undef iswcntrl
32
+ #undef iswdigit
33
+ #undef iswgraph
34
+ #undef iswlower
35
+ #undef iswprint
36
+ #undef iswprint
37
+ #undef iswpunct
38
+ #undef iswspace
39
+ #undef iswupper
40
+ #undef iswxdigit
41
+ #undef iswctype
42
+ #undef towlower
43
+ #undef towupper
44
+ #undef towctrans
45
+ #undef wctrans
46
+ #undef wctype
47
+ #endif
48
+
49
+ namespace std{
50
+
51
+ #ifndef BOOST_NO_STDC_NAMESPACE
52
+ extern "C"{
53
+ #endif
54
+
55
+ #ifdef iswalnum
56
+ inline int (iswalnum)(wint_t i)
57
+ { return iswalnum(i); }
58
+ #undef iswalnum
59
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
60
+ using ::iswalnum;
61
+ #endif
62
+
63
+ #ifdef iswalpha
64
+ inline int (iswalpha)(wint_t i)
65
+ { return iswalpha(i); }
66
+ #undef iswalpha
67
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
68
+ using ::iswalpha;
69
+ #endif
70
+
71
+ #ifdef iswcntrl
72
+ inline int (iswcntrl)(wint_t i)
73
+ { return iswcntrl(i); }
74
+ #undef iswcntrl
75
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
76
+ using ::iswcntrl;
77
+ #endif
78
+
79
+ #ifdef iswdigit
80
+ inline int (iswdigit)(wint_t i)
81
+ { return iswdigit(i); }
82
+ #undef iswdigit
83
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
84
+ using ::iswdigit;
85
+ #endif
86
+
87
+ #ifdef iswgraph
88
+ inline int (iswgraph)(wint_t i)
89
+ { return iswgraph(i); }
90
+ #undef iswgraph
91
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
92
+ using ::iswgraph;
93
+ #endif
94
+
95
+ #ifdef iswlower
96
+ inline int (iswlower)(wint_t i)
97
+ { return iswlower(i); }
98
+ #undef iswlower
99
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
100
+ using ::iswlower;
101
+ #endif
102
+
103
+ #ifdef iswprint
104
+ inline int (iswprint)(wint_t i)
105
+ { return iswprint(i); }
106
+ #undef iswprint
107
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
108
+ using ::iswprint;
109
+ #endif
110
+
111
+ #ifdef iswpunct
112
+ inline int (iswpunct)(wint_t i)
113
+ { return iswpunct(i); }
114
+ #undef iswpunct
115
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
116
+ using ::iswpunct;
117
+ #endif
118
+
119
+ #ifdef iswspace
120
+ inline int (iswspace)(wint_t i)
121
+ { return iswspace(i); }
122
+ #undef iswspace
123
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
124
+ using ::iswspace;
125
+ #endif
126
+
127
+ #ifdef iswupper
128
+ inline int (iswupper)(wint_t i)
129
+ { return iswupper(i); }
130
+ #undef iswupper
131
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
132
+ using ::iswupper;
133
+ #endif
134
+
135
+ #ifdef iswxdigit
136
+ inline int (iswxdigit)(wint_t i)
137
+ { return iswxdigit(i); }
138
+ #undef iswxdigit
139
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
140
+ using ::iswxdigit;
141
+ #endif
142
+
143
+ #ifdef towlower
144
+ inline wint_t (towlower)(wint_t i)
145
+ { return towlower(i); }
146
+ #undef towlower
147
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
148
+ using ::towlower;
149
+ #endif
150
+
151
+ #ifdef towupper
152
+ inline wint_t (towupper)(wint_t i)
153
+ { return towupper(i); }
154
+ #undef towupper
155
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
156
+ using :: towupper;
157
+ #endif
158
+
159
+ #ifdef wcscmp
160
+ inline int (wcscmp)(const wchar_t *p1, const wchar_t *p2)
161
+ { return wcscmp(p1,p2); }
162
+ #undef wcscmp
163
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
164
+ using ::wcscmp;
165
+ #endif
166
+
167
+ #ifdef wcscoll
168
+ inline int (wcscoll)(const wchar_t *p1, const wchar_t *p2)
169
+ { return wcscoll(p1,p2); }
170
+ #undef wcscoll
171
+ #elif defined(BOOST_NO_STDC_NAMESPACE) && !defined(UNDER_CE)
172
+ using ::wcscoll;
173
+ #endif
174
+
175
+ #ifdef wcscpy
176
+ inline wchar_t *(wcscpy)(wchar_t *p1, const wchar_t *p2)
177
+ { return wcscpy(p1,p2); }
178
+ #undef wcscpy
179
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
180
+ using ::wcscpy;
181
+ #endif
182
+
183
+ #ifdef wcslen
184
+ inline size_t (wcslen)(const wchar_t *p)
185
+ { return wcslen(p); }
186
+ #undef wcslen
187
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
188
+ using ::wcslen;
189
+ #endif
190
+
191
+ #ifdef wcsxfrm
192
+ size_t wcsxfrm(wchar_t *p1, const wchar_t *p2, size_t s)
193
+ { return wcsxfrm(p1,p2,s); }
194
+ #undef wcsxfrm
195
+ #elif defined(BOOST_NO_STDC_NAMESPACE)
196
+ using ::wcsxfrm;
197
+ #endif
198
+
199
+
200
+ #ifndef BOOST_NO_STDC_NAMESPACE
201
+ } // extern "C"
202
+ #endif
203
+
204
+ } // namespace std
205
+
206
+ #endif
207
+
@@ -0,0 +1,190 @@
1
+ /*
2
+ *
3
+ * Copyright (c) 2004
4
+ * John Maddock
5
+ *
6
+ * Use, modification and distribution are subject to the
7
+ * Boost Software License, Version 1.0. (See accompanying file
8
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9
+ *
10
+ */
11
+
12
+ /*
13
+ * LOCATION: see http://www.boost.org for most recent version.
14
+ * FILE mfc.hpp
15
+ * VERSION see <boost/version.hpp>
16
+ * DESCRIPTION: Overloads and helpers for using MFC/ATL string types with Boost.Regex.
17
+ */
18
+
19
+ #ifndef BOOST_REGEX_MFC_HPP
20
+ #define BOOST_REGEX_MFC_HPP
21
+
22
+ #include <atlsimpstr.h>
23
+ #include <boost/regex.hpp>
24
+
25
+ namespace boost{
26
+
27
+ //
28
+ // define the types used for TCHAR's:
29
+ typedef basic_regex<TCHAR> tregex;
30
+ typedef match_results<TCHAR const*> tmatch;
31
+ typedef regex_iterator<TCHAR const*> tregex_iterator;
32
+ typedef regex_token_iterator<TCHAR const*> tregex_token_iterator;
33
+
34
+ #if _MSC_VER >= 1310
35
+ #define SIMPLE_STRING_PARAM class B, bool b
36
+ #define SIMPLE_STRING_ARG_LIST B, b
37
+ #else
38
+ #define SIMPLE_STRING_PARAM class B
39
+ #define SIMPLE_STRING_ARG_LIST B
40
+ #endif
41
+
42
+ //
43
+ // define regex creation functions:
44
+ //
45
+ template <SIMPLE_STRING_PARAM>
46
+ inline basic_regex<B>
47
+ make_regex(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, ::boost::regex_constants::syntax_option_type f = boost::regex_constants::normal)
48
+ {
49
+ basic_regex<B> result(s.GetString(), s.GetString() + s.GetLength(), f);
50
+ return result;
51
+ }
52
+ //
53
+ // regex_match overloads:
54
+ //
55
+ template <SIMPLE_STRING_PARAM, class A, class T>
56
+ inline bool regex_match(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
57
+ match_results<const B*, A>& what,
58
+ const basic_regex<B, T>& e,
59
+ boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
60
+ {
61
+ return ::boost::regex_match(s.GetString(),
62
+ s.GetString() + s.GetLength(),
63
+ what,
64
+ e,
65
+ f);
66
+ }
67
+
68
+ template <SIMPLE_STRING_PARAM, class T>
69
+ inline bool regex_match(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
70
+ const basic_regex<B, T>& e,
71
+ boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
72
+ {
73
+ return ::boost::regex_match(s.GetString(),
74
+ s.GetString() + s.GetLength(),
75
+ e,
76
+ f);
77
+ }
78
+ //
79
+ // regex_search overloads:
80
+ //
81
+ template <SIMPLE_STRING_PARAM, class A, class T>
82
+ inline bool regex_search(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
83
+ match_results<const B*, A>& what,
84
+ const basic_regex<B, T>& e,
85
+ boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
86
+ {
87
+ return ::boost::regex_search(s.GetString(),
88
+ s.GetString() + s.GetLength(),
89
+ what,
90
+ e,
91
+ f);
92
+ }
93
+
94
+ template <SIMPLE_STRING_PARAM, class T>
95
+ inline bool regex_search(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
96
+ const basic_regex<B, T>& e,
97
+ boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
98
+ {
99
+ return ::boost::regex_search(s.GetString(),
100
+ s.GetString() + s.GetLength(),
101
+ e,
102
+ f);
103
+ }
104
+ //
105
+ // regex_iterator creation:
106
+ //
107
+ template <SIMPLE_STRING_PARAM>
108
+ inline regex_iterator<B const*>
109
+ make_regex_iterator(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, const basic_regex<B>& e, ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
110
+ {
111
+ regex_iterator<B const*> result(s.GetString(), s.GetString() + s.GetLength(), e, f);
112
+ return result;
113
+ }
114
+
115
+ template <SIMPLE_STRING_PARAM>
116
+ inline regex_token_iterator<B const*>
117
+ make_regex_token_iterator(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, const basic_regex<B>& e, int sub = 0, ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
118
+ {
119
+ regex_token_iterator<B const*> result(s.GetString(), s.GetString() + s.GetLength(), e, sub, f);
120
+ return result;
121
+ }
122
+
123
+ template <SIMPLE_STRING_PARAM>
124
+ inline regex_token_iterator<B const*>
125
+ make_regex_token_iterator(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, const basic_regex<B>& e, const std::vector<int>& subs, ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
126
+ {
127
+ regex_token_iterator<B const*> result(s.GetString(), s.GetString() + s.GetLength(), e, subs, f);
128
+ return result;
129
+ }
130
+
131
+ template <SIMPLE_STRING_PARAM, std::size_t N>
132
+ inline regex_token_iterator<B const*>
133
+ make_regex_token_iterator(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s, const basic_regex<B>& e, const int (& subs)[N], ::boost::regex_constants::match_flag_type f = boost::regex_constants::match_default)
134
+ {
135
+ regex_token_iterator<B const*> result(s.GetString(), s.GetString() + s.GetLength(), e, subs, f);
136
+ return result;
137
+ }
138
+
139
+ template <class OutputIterator, class BidirectionalIterator, class traits,
140
+ SIMPLE_STRING_PARAM>
141
+ OutputIterator regex_replace(OutputIterator out,
142
+ BidirectionalIterator first,
143
+ BidirectionalIterator last,
144
+ const basic_regex<B, traits>& e,
145
+ const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& fmt,
146
+ match_flag_type flags = match_default)
147
+ {
148
+ return ::boost::regex_replace(out, first, last, e, fmt.GetString(), flags);
149
+ }
150
+
151
+ namespace re_detail{
152
+
153
+ template <SIMPLE_STRING_PARAM>
154
+ class mfc_string_out_iterator
155
+ {
156
+ ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>* out;
157
+ public:
158
+ mfc_string_out_iterator(ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s) : out(&s) {}
159
+ mfc_string_out_iterator& operator++() { return *this; }
160
+ mfc_string_out_iterator& operator++(int) { return *this; }
161
+ mfc_string_out_iterator& operator*() { return *this; }
162
+ mfc_string_out_iterator& operator=(B v)
163
+ {
164
+ out->AppendChar(v);
165
+ return *this;
166
+ }
167
+ typedef std::ptrdiff_t difference_type;
168
+ typedef B value_type;
169
+ typedef value_type* pointer;
170
+ typedef value_type& reference;
171
+ typedef std::output_iterator_tag iterator_category;
172
+ };
173
+
174
+ }
175
+
176
+ template <class traits, SIMPLE_STRING_PARAM>
177
+ ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST> regex_replace(const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& s,
178
+ const basic_regex<B, traits>& e,
179
+ const ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST>& fmt,
180
+ match_flag_type flags = match_default)
181
+ {
182
+ ATL::CSimpleStringT<SIMPLE_STRING_ARG_LIST> result(s.GetManager());
183
+ re_detail::mfc_string_out_iterator<SIMPLE_STRING_ARG_LIST> i(result);
184
+ regex_replace(i, s.GetString(), s.GetString() + s.GetLength(), e, fmt.GetString(), flags);
185
+ return result;
186
+ }
187
+
188
+ } // namespace boost.
189
+
190
+ #endif
@@ -0,0 +1,100 @@
1
+ /*
2
+ *
3
+ * Copyright (c) 1998-2002
4
+ * John Maddock
5
+ *
6
+ * Use, modification and distribution are subject to the
7
+ * Boost Software License, Version 1.0. (See accompanying file
8
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9
+ *
10
+ */
11
+
12
+ /*
13
+ * LOCATION: see http://www.boost.org for most recent version.
14
+ * FILE pattern_except.hpp
15
+ * VERSION see <boost/version.hpp>
16
+ * DESCRIPTION: Declares pattern-matching exception classes.
17
+ */
18
+
19
+ #ifndef BOOST_RE_PAT_EXCEPT_HPP
20
+ #define BOOST_RE_PAT_EXCEPT_HPP
21
+
22
+ #ifndef BOOST_REGEX_CONFIG_HPP
23
+ #include <boost/regex/config.hpp>
24
+ #endif
25
+
26
+ #include <stdexcept>
27
+ #include <cstddef>
28
+ #include <boost/regex/v4/error_type.hpp>
29
+
30
+ namespace boost{
31
+
32
+ #ifdef BOOST_MSVC
33
+ #pragma warning(push)
34
+ #pragma warning(disable: 4103)
35
+ #endif
36
+ #ifdef BOOST_HAS_ABI_HEADERS
37
+ # include BOOST_ABI_PREFIX
38
+ #endif
39
+ #ifdef BOOST_MSVC
40
+ #pragma warning(pop)
41
+ #endif
42
+
43
+ #ifdef BOOST_MSVC
44
+ #pragma warning(push)
45
+ #pragma warning(disable : 4275)
46
+ #endif
47
+ class BOOST_REGEX_DECL regex_error : public std::runtime_error
48
+ {
49
+ public:
50
+ explicit regex_error(const std::string& s, regex_constants::error_type err = regex_constants::error_unknown, std::ptrdiff_t pos = 0);
51
+ explicit regex_error(regex_constants::error_type err);
52
+ ~regex_error() throw();
53
+ regex_constants::error_type code()const
54
+ { return m_error_code; }
55
+ std::ptrdiff_t position()const
56
+ { return m_position; }
57
+ void raise()const;
58
+ private:
59
+ regex_constants::error_type m_error_code;
60
+ std::ptrdiff_t m_position;
61
+ };
62
+
63
+ typedef regex_error bad_pattern;
64
+ typedef regex_error bad_expression;
65
+
66
+ namespace re_detail{
67
+
68
+ BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex);
69
+
70
+ template <class traits>
71
+ void raise_error(const traits& t, regex_constants::error_type code)
72
+ {
73
+ (void)t; // warning suppression
74
+ std::runtime_error e(t.error_string(code));
75
+ ::boost::re_detail::raise_runtime_error(e);
76
+ }
77
+
78
+ }
79
+
80
+ #ifdef BOOST_MSVC
81
+ #pragma warning(pop)
82
+ #endif
83
+
84
+ #ifdef BOOST_MSVC
85
+ #pragma warning(push)
86
+ #pragma warning(disable: 4103)
87
+ #endif
88
+ #ifdef BOOST_HAS_ABI_HEADERS
89
+ # include BOOST_ABI_SUFFIX
90
+ #endif
91
+ #ifdef BOOST_MSVC
92
+ #pragma warning(pop)
93
+ #endif
94
+
95
+ } // namespace boost
96
+
97
+ #endif
98
+
99
+
100
+