From 6ffcc5ede027e3b81df56c11abab5ec43b5f8d04 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 4 Apr 2015 19:10:37 +0100 Subject: [PATCH] Change detail namespace. Big search and replace to change name of internal namepace so it's mangled with the Boost version number - the aim is to reduce the chances of mixing different header and library versions. --- include/boost/regex/config.hpp | 12 +- include/boost/regex/icu.hpp | 166 +++++++++--------- include/boost/regex/mfc.hpp | 4 +- include/boost/regex/pattern_except.hpp | 4 +- include/boost/regex/v4/basic_regex.hpp | 26 +-- .../boost/regex/v4/basic_regex_creator.hpp | 36 ++-- include/boost/regex/v4/basic_regex_parser.hpp | 20 +-- include/boost/regex/v4/cpp_regex_traits.hpp | 138 +++++++-------- include/boost/regex/v4/cregex.hpp | 14 +- include/boost/regex/v4/fileiter.hpp | 18 +- include/boost/regex/v4/instances.hpp | 12 +- include/boost/regex/v4/iterator_traits.hpp | 4 +- include/boost/regex/v4/match_results.hpp | 34 ++-- include/boost/regex/v4/mem_block_cache.hpp | 2 +- include/boost/regex/v4/perl_matcher.hpp | 4 +- .../boost/regex/v4/perl_matcher_common.hpp | 12 +- .../regex/v4/perl_matcher_non_recursive.hpp | 42 ++--- .../boost/regex/v4/perl_matcher_recursive.hpp | 16 +- include/boost/regex/v4/primary_transform.hpp | 4 +- include/boost/regex/v4/protected_call.hpp | 2 +- include/boost/regex/v4/regex_format.hpp | 28 +-- include/boost/regex/v4/regex_grep.hpp | 2 +- include/boost/regex/v4/regex_iterator.hpp | 6 +- include/boost/regex/v4/regex_match.hpp | 2 +- include/boost/regex/v4/regex_raw_buffer.hpp | 4 +- include/boost/regex/v4/regex_replace.hpp | 8 +- include/boost/regex/v4/regex_search.hpp | 4 +- include/boost/regex/v4/regex_split.hpp | 8 +- .../boost/regex/v4/regex_token_iterator.hpp | 6 +- include/boost/regex/v4/regex_traits.hpp | 16 +- .../boost/regex/v4/regex_traits_defaults.hpp | 8 +- include/boost/regex/v4/regex_workaround.hpp | 7 +- include/boost/regex/v4/states.hpp | 4 +- include/boost/regex/v4/sub_match.hpp | 138 +++++++-------- include/boost/regex/v4/u32regex_iterator.hpp | 4 +- .../regex/v4/u32regex_token_iterator.hpp | 4 +- include/boost/regex/v4/w32_regex_traits.hpp | 78 ++++---- src/c_regex_traits.cpp | 22 +-- src/cpp_regex_traits.cpp | 6 +- src/cregex.cpp | 80 ++++----- src/fileiter.cpp | 46 ++--- src/icu.cpp | 22 +-- src/posix_api.cpp | 10 +- src/regex.cpp | 6 +- src/regex_raw_buffer.cpp | 2 +- src/regex_traits_defaults.cpp | 4 +- src/w32_regex_traits.cpp | 14 +- src/wc_regex_traits.cpp | 22 +-- src/wide_posix_api.cpp | 4 +- test/collate_info/collate_info.cpp | 10 +- test/regress/test_icu.cpp | 4 +- test/regress/test_mfc.cpp | 16 +- test/regress/test_partial_match.hpp | 16 +- test/regress/test_regex_search.hpp | 24 +-- tools/generate/tables.cpp | 2 +- 55 files changed, 609 insertions(+), 598 deletions(-) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index 7e6cc519..fc0b024d 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -25,6 +25,7 @@ #if defined(__BORLANDC__) # include #endif +#include /***************************************************************************** * @@ -69,6 +70,13 @@ #define UNICODE #endif + +/* +* Define a macro for the namespace that details are placed in, this includes the Boost +* version number to avoid mismatched header and library versions: +*/ +#define BOOST_REGEX_DETAIL_NS BOOST_JOIN(re_detail_, BOOST_VERSION) + /* * Fix for gcc prior to 3.4: std::ctype doesn't allow * masks to be combined, for example: @@ -334,7 +342,7 @@ if(0 == (x))\ #if defined(__cplusplus) && defined(BOOST_REGEX_HAS_MS_STACK_GUARD) namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page(); @@ -387,7 +395,7 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page(); ****************************************************************************/ #if defined(__cplusplus) && defined(BOOST_REGEX_NON_RECURSIVE) -namespace boost{ namespace re_detail{ +namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block(); BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void*); diff --git a/include/boost/regex/icu.hpp b/include/boost/regex/icu.hpp index 572172e5..a70aa0da 100644 --- a/include/boost/regex/icu.hpp +++ b/include/boost/regex/icu.hpp @@ -34,7 +34,7 @@ namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ // // Implementation details: @@ -108,18 +108,18 @@ public: struct boost_extensions_tag{}; icu_regex_traits() - : m_pimpl(re_detail::get_icu_regex_traits_implementation(U_NAMESPACE_QUALIFIER Locale())) + : m_pimpl(BOOST_REGEX_DETAIL_NS::get_icu_regex_traits_implementation(U_NAMESPACE_QUALIFIER Locale())) { } static size_type length(const char_type* p); ::boost::regex_constants::syntax_type syntax_type(char_type c)const { - return ((c < 0x7f) && (c > 0)) ? re_detail::get_default_syntax_type(static_cast(c)) : regex_constants::syntax_char; + return ((c < 0x7f) && (c > 0)) ? BOOST_REGEX_DETAIL_NS::get_default_syntax_type(static_cast(c)) : regex_constants::syntax_char; } ::boost::regex_constants::escape_syntax_type escape_syntax_type(char_type c) const { - return ((c < 0x7f) && (c > 0)) ? re_detail::get_default_escape_syntax_type(static_cast(c)) : regex_constants::syntax_char; + return ((c < 0x7f) && (c > 0)) ? BOOST_REGEX_DETAIL_NS::get_default_escape_syntax_type(static_cast(c)) : regex_constants::syntax_char; } char_type translate(char_type c) const { @@ -154,7 +154,7 @@ public: bool isctype(char_type c, char_class_type f) const; int toi(const char_type*& p1, const char_type* p2, int radix)const { - return re_detail::global_toi(p1, p2, radix, *this); + return BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this); } int value(char_type c, int radix)const { @@ -163,7 +163,7 @@ public: locale_type imbue(locale_type l) { locale_type result(m_pimpl->getloc()); - m_pimpl = re_detail::get_icu_regex_traits_implementation(l); + m_pimpl = BOOST_REGEX_DETAIL_NS::get_icu_regex_traits_implementation(l); return result; } locale_type getloc()const @@ -172,7 +172,7 @@ public: } std::string error_string(::boost::regex_constants::error_type n) const { - return re_detail::get_default_error_string(n); + return BOOST_REGEX_DETAIL_NS::get_default_error_string(n); } private: icu_regex_traits(const icu_regex_traits&); @@ -208,7 +208,7 @@ private: static char_class_type lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2); - boost::shared_ptr< ::boost::re_detail::icu_regex_traits_implementation> m_pimpl; + boost::shared_ptr< ::boost::BOOST_REGEX_DETAIL_NS::icu_regex_traits_implementation> m_pimpl; }; } // namespace boost @@ -241,7 +241,7 @@ typedef match_results u16match; // // Construction of 32-bit regex types from UTF-8 and UTF-16 primitives: // -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ #if !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__) template @@ -341,18 +341,18 @@ inline u32regex make_u32regex(InputIterator i, InputIterator j, boost::regex_constants::syntax_option_type opt) { - return re_detail::do_make_u32regex(i, j, opt, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_make_u32regex(i, j, opt, static_cast const*>(0)); } // // construction from UTF-8 nul-terminated strings: // inline u32regex make_u32regex(const char* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl) { - return re_detail::do_make_u32regex(p, p + std::strlen(p), opt, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + std::strlen(p), opt, static_cast const*>(0)); } inline u32regex make_u32regex(const unsigned char* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl) { - return re_detail::do_make_u32regex(p, p + std::strlen(reinterpret_cast(p)), opt, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + std::strlen(reinterpret_cast(p)), opt, static_cast const*>(0)); } // // construction from UTF-16 nul-terminated strings: @@ -360,13 +360,13 @@ inline u32regex make_u32regex(const unsigned char* p, boost::regex_constants::sy #ifndef BOOST_NO_WREGEX inline u32regex make_u32regex(const wchar_t* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl) { - return re_detail::do_make_u32regex(p, p + std::wcslen(p), opt, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + std::wcslen(p), opt, static_cast const*>(0)); } #endif #if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) inline u32regex make_u32regex(const UChar* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl) { - return re_detail::do_make_u32regex(p, p + u_strlen(p), opt, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + u_strlen(p), opt, static_cast const*>(0)); } #endif // @@ -375,20 +375,20 @@ inline u32regex make_u32regex(const UChar* p, boost::regex_constants::syntax_opt template inline u32regex make_u32regex(const std::basic_string& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl) { - return re_detail::do_make_u32regex(s.begin(), s.end(), opt, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_make_u32regex(s.begin(), s.end(), opt, static_cast const*>(0)); } // // Construction from ICU string type: // inline u32regex make_u32regex(const U_NAMESPACE_QUALIFIER UnicodeString& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl) { - return re_detail::do_make_u32regex(s.getBuffer(), s.getBuffer() + s.length(), opt, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_make_u32regex(s.getBuffer(), s.getBuffer() + s.length(), opt, static_cast const*>(0)); } // // regex_match overloads that widen the character type as appropriate: // -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template void copy_results(MR1& out, MR2 const& in) { @@ -446,7 +446,7 @@ bool do_regex_match(BidiIterator first, BidiIterator last, if(result) copy_results(m, what); return result; } -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS template inline bool u32regex_match(BidiIterator first, BidiIterator last, @@ -454,14 +454,14 @@ inline bool u32regex_match(BidiIterator first, BidiIterator last, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_match(first, last, m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(first, last, m, e, flags, static_cast const*>(0)); } inline bool u32regex_match(const UChar* p, match_results& m, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast const*>(0)); } #if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX) inline bool u32regex_match(const wchar_t* p, @@ -469,7 +469,7 @@ inline bool u32regex_match(const wchar_t* p, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast const*>(0)); } #endif inline bool u32regex_match(const char* p, @@ -477,21 +477,21 @@ inline bool u32regex_match(const char* p, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast const*>(0)); } inline bool u32regex_match(const unsigned char* p, match_results& m, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast const*>(0)); } inline bool u32regex_match(const std::string& s, match_results& m, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); } #ifndef BOOST_NO_STD_WSTRING inline bool u32regex_match(const std::wstring& s, @@ -499,7 +499,7 @@ inline bool u32regex_match(const std::wstring& s, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); } #endif inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, @@ -507,7 +507,7 @@ inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast const*>(0)); } // // regex_match overloads that do not return what matched: @@ -518,14 +518,14 @@ inline bool u32regex_match(BidiIterator first, BidiIterator last, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_match(first, last, m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(first, last, m, e, flags, static_cast const*>(0)); } inline bool u32regex_match(const UChar* p, const u32regex& e, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast const*>(0)); } #if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX) inline bool u32regex_match(const wchar_t* p, @@ -533,7 +533,7 @@ inline bool u32regex_match(const wchar_t* p, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast const*>(0)); } #endif inline bool u32regex_match(const char* p, @@ -541,21 +541,21 @@ inline bool u32regex_match(const char* p, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast const*>(0)); } inline bool u32regex_match(const unsigned char* p, const u32regex& e, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast const*>(0)); } inline bool u32regex_match(const std::string& s, const u32regex& e, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); } #ifndef BOOST_NO_STD_WSTRING inline bool u32regex_match(const std::wstring& s, @@ -563,7 +563,7 @@ inline bool u32regex_match(const std::wstring& s, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); } #endif inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, @@ -571,13 +571,13 @@ inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast const*>(0)); } // // regex_search overloads that widen the character type as appropriate: // -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template inline bool do_regex_search(BidiIterator first, BidiIterator last, match_results& m, @@ -630,7 +630,7 @@ inline bool u32regex_search(BidiIterator first, BidiIterator last, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_search(first, last, m, e, flags, first, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(first, last, m, e, flags, first, static_cast const*>(0)); } template inline bool u32regex_search(BidiIterator first, BidiIterator last, @@ -639,14 +639,14 @@ inline bool u32regex_search(BidiIterator first, BidiIterator last, match_flag_type flags, BidiIterator base) { - return re_detail::do_regex_search(first, last, m, e, flags, base, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(first, last, m, e, flags, base, static_cast const*>(0)); } inline bool u32regex_search(const UChar* p, match_results& m, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast const*>(0)); } #if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX) inline bool u32regex_search(const wchar_t* p, @@ -654,7 +654,7 @@ inline bool u32regex_search(const wchar_t* p, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast const*>(0)); } #endif inline bool u32regex_search(const char* p, @@ -662,21 +662,21 @@ inline bool u32regex_search(const char* p, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast const*>(0)); } inline bool u32regex_search(const unsigned char* p, match_results& m, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast const*>(0)); } inline bool u32regex_search(const std::string& s, match_results& m, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); } #ifndef BOOST_NO_STD_WSTRING inline bool u32regex_search(const std::wstring& s, @@ -684,7 +684,7 @@ inline bool u32regex_search(const std::wstring& s, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); } #endif inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, @@ -692,7 +692,7 @@ inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, match_flag_type flags = match_default) { - return re_detail::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast const*>(0)); } template inline bool u32regex_search(BidiIterator first, BidiIterator last, @@ -700,14 +700,14 @@ inline bool u32regex_search(BidiIterator first, BidiIterator last, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_search(first, last, m, e, flags, first, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(first, last, m, e, flags, first, static_cast const*>(0)); } inline bool u32regex_search(const UChar* p, const u32regex& e, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast const*>(0)); } #if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX) inline bool u32regex_search(const wchar_t* p, @@ -715,7 +715,7 @@ inline bool u32regex_search(const wchar_t* p, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast const*>(0)); } #endif inline bool u32regex_search(const char* p, @@ -723,21 +723,21 @@ inline bool u32regex_search(const char* p, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast const*>(0)); } inline bool u32regex_search(const unsigned char* p, const u32regex& e, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast const*>(0)); } inline bool u32regex_search(const std::string& s, const u32regex& e, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); } #ifndef BOOST_NO_STD_WSTRING inline bool u32regex_search(const std::wstring& s, @@ -745,7 +745,7 @@ inline bool u32regex_search(const std::wstring& s, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); } #endif inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, @@ -753,13 +753,13 @@ inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, match_flag_type flags = match_default) { match_results m; - return re_detail::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast const*>(0)); + return BOOST_REGEX_DETAIL_NS::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast const*>(0)); } // // overloads for regex_replace with utf-8 and utf-16 data types: // -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template inline std::pair< boost::u8_to_u32_iterator, boost::u8_to_u32_iterator > make_utf32_seq(I i, I j, mpl::int_<1> const*) @@ -838,7 +838,7 @@ OutputIterator do_regex_replace(OutputIterator out, if(i == j) { if(!(flags & regex_constants::format_no_copy)) - out = re_detail::copy(in.first, in.second, out); + out = BOOST_REGEX_DETAIL_NS::copy(in.first, in.second, out); } else { @@ -846,18 +846,18 @@ OutputIterator do_regex_replace(OutputIterator out, while(i != j) { if(!(flags & regex_constants::format_no_copy)) - out = re_detail::copy(i->prefix().first, i->prefix().second, out); + out = BOOST_REGEX_DETAIL_NS::copy(i->prefix().first, i->prefix().second, out); if(f.size()) - out = ::boost::re_detail::regex_format_imp(out, *i, &*f.begin(), &*f.begin() + f.size(), flags, e.get_traits()); + out = ::boost::BOOST_REGEX_DETAIL_NS::regex_format_imp(out, *i, &*f.begin(), &*f.begin() + f.size(), flags, e.get_traits()); else - out = ::boost::re_detail::regex_format_imp(out, *i, static_cast(0), static_cast(0), flags, e.get_traits()); + out = ::boost::BOOST_REGEX_DETAIL_NS::regex_format_imp(out, *i, static_cast(0), static_cast(0), flags, e.get_traits()); last_m = (*i)[0].second; if(flags & regex_constants::format_first_only) break; ++i; } if(!(flags & regex_constants::format_no_copy)) - out = re_detail::copy(last_m, in.second, out); + out = BOOST_REGEX_DETAIL_NS::copy(last_m, in.second, out); } return out; } @@ -876,7 +876,7 @@ inline BaseIterator extract_output_base(const utf16_output_iterator inline OutputIterator u32regex_replace(OutputIterator out, @@ -886,13 +886,13 @@ inline OutputIterator u32regex_replace(OutputIterator out, const charT* fmt, match_flag_type flags = match_default) { - return re_detail::extract_output_base + return BOOST_REGEX_DETAIL_NS::extract_output_base ( - re_detail::do_regex_replace( - re_detail::make_utf32_out(out, static_cast const*>(0)), - re_detail::make_utf32_seq(first, last, static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::do_regex_replace( + BOOST_REGEX_DETAIL_NS::make_utf32_out(out, static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::make_utf32_seq(first, last, static_cast const*>(0)), e, - re_detail::make_utf32_seq(fmt, static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt, static_cast const*>(0)), flags) ); } @@ -905,13 +905,13 @@ inline OutputIterator u32regex_replace(OutputIterator out, const std::basic_string& fmt, match_flag_type flags = match_default) { - return re_detail::extract_output_base + return BOOST_REGEX_DETAIL_NS::extract_output_base ( - re_detail::do_regex_replace( - re_detail::make_utf32_out(out, static_cast const*>(0)), - re_detail::make_utf32_seq(first, last, static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::do_regex_replace( + BOOST_REGEX_DETAIL_NS::make_utf32_out(out, static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::make_utf32_seq(first, last, static_cast const*>(0)), e, - re_detail::make_utf32_seq(fmt.begin(), fmt.end(), static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt.begin(), fmt.end(), static_cast const*>(0)), flags) ); } @@ -924,13 +924,13 @@ inline OutputIterator u32regex_replace(OutputIterator out, const U_NAMESPACE_QUALIFIER UnicodeString& fmt, match_flag_type flags = match_default) { - return re_detail::extract_output_base + return BOOST_REGEX_DETAIL_NS::extract_output_base ( - re_detail::do_regex_replace( - re_detail::make_utf32_out(out, static_cast const*>(0)), - re_detail::make_utf32_seq(first, last, static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::do_regex_replace( + BOOST_REGEX_DETAIL_NS::make_utf32_out(out, static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::make_utf32_seq(first, last, static_cast const*>(0)), e, - re_detail::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast const*>(0)), flags) ); } @@ -942,7 +942,7 @@ std::basic_string u32regex_replace(const std::basic_string& s, match_flag_type flags = match_default) { std::basic_string result; - re_detail::string_out_iterator > i(result); + BOOST_REGEX_DETAIL_NS::string_out_iterator > i(result); u32regex_replace(i, s.begin(), s.end(), e, fmt, flags); return result; } @@ -954,12 +954,12 @@ std::basic_string u32regex_replace(const std::basic_string& s, match_flag_type flags = match_default) { std::basic_string result; - re_detail::string_out_iterator > i(result); + BOOST_REGEX_DETAIL_NS::string_out_iterator > i(result); u32regex_replace(i, s.begin(), s.end(), e, fmt.c_str(), flags); return result; } -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ class unicode_string_out_iterator { @@ -989,7 +989,7 @@ inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QU match_flag_type flags = match_default) { U_NAMESPACE_QUALIFIER UnicodeString result; - re_detail::unicode_string_out_iterator i(result); + BOOST_REGEX_DETAIL_NS::unicode_string_out_iterator i(result); u32regex_replace(i, s.getBuffer(), s.getBuffer()+s.length(), e, fmt, flags); return result; } @@ -1000,12 +1000,12 @@ inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QU match_flag_type flags = match_default) { U_NAMESPACE_QUALIFIER UnicodeString result; - re_detail::unicode_string_out_iterator i(result); - re_detail::do_regex_replace( - re_detail::make_utf32_out(i, static_cast const*>(0)), - re_detail::make_utf32_seq(s.getBuffer(), s.getBuffer()+s.length(), static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::unicode_string_out_iterator i(result); + BOOST_REGEX_DETAIL_NS::do_regex_replace( + BOOST_REGEX_DETAIL_NS::make_utf32_out(i, static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::make_utf32_seq(s.getBuffer(), s.getBuffer()+s.length(), static_cast const*>(0)), e, - re_detail::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast const*>(0)), + BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast const*>(0)), flags); return result; } diff --git a/include/boost/regex/mfc.hpp b/include/boost/regex/mfc.hpp index 8ecaf1f5..d7806739 100644 --- a/include/boost/regex/mfc.hpp +++ b/include/boost/regex/mfc.hpp @@ -144,7 +144,7 @@ OutputIterator regex_replace(OutputIterator out, return ::boost::regex_replace(out, first, last, e, fmt.GetString(), flags); } -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template class mfc_string_out_iterator @@ -176,7 +176,7 @@ ATL::CSimpleStringT regex_replace(const ATL::CSimpleStringT& s, match_flag_type flags = match_default) { ATL::CSimpleStringT result(s.GetManager()); - re_detail::mfc_string_out_iterator i(result); + BOOST_REGEX_DETAIL_NS::mfc_string_out_iterator i(result); regex_replace(i, s.GetString(), s.GetString() + s.GetLength(), e, fmt.GetString(), flags); return result; } diff --git a/include/boost/regex/pattern_except.hpp b/include/boost/regex/pattern_except.hpp index 57ea14c2..004b67f3 100644 --- a/include/boost/regex/pattern_except.hpp +++ b/include/boost/regex/pattern_except.hpp @@ -63,7 +63,7 @@ private: typedef regex_error bad_pattern; typedef regex_error bad_expression; -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex); @@ -72,7 +72,7 @@ void raise_error(const traits& t, regex_constants::error_type code) { (void)t; // warning suppression std::runtime_error e(t.error_string(code)); - ::boost::re_detail::raise_runtime_error(e); + ::boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(e); } } diff --git a/include/boost/regex/v4/basic_regex.hpp b/include/boost/regex/v4/basic_regex.hpp index ae861522..68c3124e 100644 --- a/include/boost/regex/v4/basic_regex.hpp +++ b/include/boost/regex/v4/basic_regex.hpp @@ -42,7 +42,7 @@ namespace boost{ #endif #endif -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ // // forward declaration, we will need this one later: @@ -176,11 +176,11 @@ struct regex_data : public named_subexpressions const charT* m_expression; // the original expression std::ptrdiff_t m_expression_len; // the length of the original expression size_type m_mark_count; // the number of marked sub-expressions - re_detail::re_syntax_base* m_first_state; // the first state of the machine + BOOST_REGEX_DETAIL_NS::re_syntax_base* m_first_state; // the first state of the machine unsigned m_restart_type; // search optimisation type unsigned char m_startmap[1 << CHAR_BIT]; // which characters can start a match unsigned int m_can_be_null; // whether we can match a null string - re_detail::raw_storage m_data; // the buffer in which our states are constructed + BOOST_REGEX_DETAIL_NS::raw_storage m_data; // the buffer in which our states are constructed typename traits::char_class_type m_word_mask; // mask used to determine if a character is a word character std::vector< std::pair< @@ -266,7 +266,7 @@ public: { return this->m_mark_count - 1; } - const re_detail::re_syntax_base* get_first_state()const + const BOOST_REGEX_DETAIL_NS::re_syntax_base* get_first_state()const { return this->m_first_state; } @@ -293,7 +293,7 @@ public: } }; -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS // // class basic_regex: // represents the compiled @@ -597,7 +597,7 @@ public: // // private access methods: // - const re_detail::re_syntax_base* get_first_state()const + const BOOST_REGEX_DETAIL_NS::re_syntax_base* get_first_state()const { BOOST_ASSERT(0 != m_pimpl.get()); return m_pimpl->get_first_state(); @@ -622,18 +622,18 @@ public: BOOST_ASSERT(0 != m_pimpl.get()); return m_pimpl->can_be_null(); } - const re_detail::regex_data& get_data()const + const BOOST_REGEX_DETAIL_NS::regex_data& get_data()const { BOOST_ASSERT(0 != m_pimpl.get()); return m_pimpl->get_data(); } - boost::shared_ptr get_named_subs()const + boost::shared_ptr get_named_subs()const { return m_pimpl; } private: - shared_ptr > m_pimpl; + shared_ptr > m_pimpl; }; // @@ -647,14 +647,14 @@ basic_regex& basic_regex::do_assign(const charT* p const charT* p2, flag_type f) { - shared_ptr > temp; + shared_ptr > temp; if(!m_pimpl.get()) { - temp = shared_ptr >(new re_detail::basic_regex_implementation()); + temp = shared_ptr >(new BOOST_REGEX_DETAIL_NS::basic_regex_implementation()); } else { - temp = shared_ptr >(new re_detail::basic_regex_implementation(m_pimpl->m_ptraits)); + temp = shared_ptr >(new BOOST_REGEX_DETAIL_NS::basic_regex_implementation(m_pimpl->m_ptraits)); } temp->assign(p1, p2, f); temp.swap(m_pimpl); @@ -664,7 +664,7 @@ basic_regex& basic_regex::do_assign(const charT* p template typename basic_regex::locale_type BOOST_REGEX_CALL basic_regex::imbue(locale_type l) { - shared_ptr > temp(new re_detail::basic_regex_implementation()); + shared_ptr > temp(new BOOST_REGEX_DETAIL_NS::basic_regex_implementation()); locale_type result = temp->imbue(l); temp.swap(m_pimpl); return result; diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index 821fb829..b514edcf 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -38,7 +38,7 @@ namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template struct digraph : public std::pair @@ -371,9 +371,9 @@ re_syntax_base* basic_regex_creator::append_set( // // fill in the basics: // - result->csingles = static_cast(::boost::re_detail::distance(char_set.singles_begin(), char_set.singles_end())); - result->cranges = static_cast(::boost::re_detail::distance(char_set.ranges_begin(), char_set.ranges_end())) / 2; - result->cequivalents = static_cast(::boost::re_detail::distance(char_set.equivalents_begin(), char_set.equivalents_end())); + result->csingles = static_cast(::boost::BOOST_REGEX_DETAIL_NS::distance(char_set.singles_begin(), char_set.singles_end())); + result->cranges = static_cast(::boost::BOOST_REGEX_DETAIL_NS::distance(char_set.ranges_begin(), char_set.ranges_end())) / 2; + result->cequivalents = static_cast(::boost::BOOST_REGEX_DETAIL_NS::distance(char_set.equivalents_begin(), char_set.equivalents_end())); result->cclasses = char_set.classes(); result->cnclasses = char_set.negated_classes(); if(flags() & regbase::icase) @@ -463,10 +463,10 @@ re_syntax_base* basic_regex_creator::append_set( return 0; } charT* p = static_cast(this->m_pdata->m_data.extend(sizeof(charT) * (s1.size() + s2.size() + 2) ) ); - re_detail::copy(s1.begin(), s1.end(), p); + BOOST_REGEX_DETAIL_NS::copy(s1.begin(), s1.end(), p); p[s1.size()] = charT(0); p += s1.size() + 1; - re_detail::copy(s2.begin(), s2.end(), p); + BOOST_REGEX_DETAIL_NS::copy(s2.begin(), s2.end(), p); p[s2.size()] = charT(0); } // @@ -487,7 +487,7 @@ re_syntax_base* basic_regex_creator::append_set( if(s.empty()) return 0; // invalid or unsupported equivalence class charT* p = static_cast(this->m_pdata->m_data.extend(sizeof(charT) * (s.size()+1) ) ); - re_detail::copy(s.begin(), s.end(), p); + BOOST_REGEX_DETAIL_NS::copy(s.begin(), s.end(), p); p[s.size()] = charT(0); ++first; } @@ -664,7 +664,7 @@ void basic_regex_creator::finalize(const charT* p1, const charT* m_pdata->m_expression_len = len; charT* ps = static_cast(m_pdata->m_data.extend(sizeof(charT) * (1 + (p2 - p1)))); m_pdata->m_expression = ps; - re_detail::copy(p1, p2, ps); + BOOST_REGEX_DETAIL_NS::copy(p1, p2, ps); ps[p2 - p1] = 0; // fill in our other data... // successful parsing implies a zero status: @@ -1456,15 +1456,15 @@ syntax_element_type basic_regex_creator::get_repeat_type(re_synta { switch(state->next.p->type) { - case re_detail::syntax_element_wild: - return re_detail::syntax_element_dot_rep; - case re_detail::syntax_element_literal: - return re_detail::syntax_element_char_rep; - case re_detail::syntax_element_set: - return re_detail::syntax_element_short_set_rep; - case re_detail::syntax_element_long_set: - if(static_cast*>(state->next.p)->singleton) - return re_detail::syntax_element_long_set_rep; + case BOOST_REGEX_DETAIL_NS::syntax_element_wild: + return BOOST_REGEX_DETAIL_NS::syntax_element_dot_rep; + case BOOST_REGEX_DETAIL_NS::syntax_element_literal: + return BOOST_REGEX_DETAIL_NS::syntax_element_char_rep; + case BOOST_REGEX_DETAIL_NS::syntax_element_set: + return BOOST_REGEX_DETAIL_NS::syntax_element_short_set_rep; + case BOOST_REGEX_DETAIL_NS::syntax_element_long_set: + if(static_cast*>(state->next.p)->singleton) + return BOOST_REGEX_DETAIL_NS::syntax_element_long_set_rep; break; default: break; @@ -1529,7 +1529,7 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st } -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS } // namespace boost diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index 3c331a57..574f075d 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -31,7 +31,7 @@ #endif namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ #ifdef BOOST_MSVC #pragma warning(push) @@ -165,7 +165,7 @@ void basic_regex_parser::parse(const charT* p1, const charT* p2, // have had an unexpected ')' : if(!result) { - fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_position), "Found a closing ) with no corresponding openening parenthesis."); + fail(regex_constants::error_paren, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_position), "Found a closing ) with no corresponding openening parenthesis."); return; } // if an error has been set then give up now: @@ -489,7 +489,7 @@ bool basic_regex_parser::parse_open_paren() // if(m_position == m_end) { - this->fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_end)); + this->fail(regex_constants::error_paren, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_end)); return false; } BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark); @@ -924,9 +924,9 @@ bool basic_regex_parser::parse_match_any() static_cast( this->append_state(syntax_element_wild, sizeof(re_dot)) )->mask = static_cast(this->flags() & regbase::no_mod_s - ? re_detail::force_not_newline + ? BOOST_REGEX_DETAIL_NS::force_not_newline : this->flags() & regbase::mod_s ? - re_detail::force_newline : re_detail::dont_care); + BOOST_REGEX_DETAIL_NS::force_newline : BOOST_REGEX_DETAIL_NS::dont_care); return true; } @@ -963,7 +963,7 @@ bool basic_regex_parser::parse_repeat(std::size_t low, std::size_ } if(0 == this->m_last_state) { - fail(regex_constants::error_badrepeat, ::boost::re_detail::distance(m_base, m_position), "Nothing to repeat."); + fail(regex_constants::error_badrepeat, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_position), "Nothing to repeat."); return false; } if(this->m_last_state->type == syntax_element_endmark) @@ -1235,7 +1235,7 @@ bool basic_regex_parser::parse_alt() // // we need to append a trailing jump: // - re_syntax_base* pj = this->append_state(re_detail::syntax_element_jump, sizeof(re_jump)); + re_syntax_base* pj = this->append_state(BOOST_REGEX_DETAIL_NS::syntax_element_jump, sizeof(re_jump)); std::ptrdiff_t jump_offset = this->getoffset(pj); // // now insert the alternative: @@ -1784,7 +1784,7 @@ charT basic_regex_parser::unescape_character() { // an octal escape sequence, the first character must be a zero // followed by up to 3 octal digits: - std::ptrdiff_t len = (std::min)(::boost::re_detail::distance(m_position, m_end), static_cast(4)); + std::ptrdiff_t len = (std::min)(::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end), static_cast(4)); const charT* bp = m_position; int val = this->m_traits.toi(bp, bp + 1, 8); if(val != 0) @@ -2521,7 +2521,7 @@ option_group_jump: // Rewind to start of (? sequence: --m_position; while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; - this->fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_end)); + this->fail(regex_constants::error_paren, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_end)); return false; } BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark); @@ -2862,7 +2862,7 @@ bool basic_regex_parser::unwind_alts(std::ptrdiff_t last_paren_st #pragma warning(pop) #endif -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS } // namespace boost #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/cpp_regex_traits.hpp b/include/boost/regex/v4/cpp_regex_traits.hpp index 853a8a4e..709663a3 100644 --- a/include/boost/regex/v4/cpp_regex_traits.hpp +++ b/include/boost/regex/v4/cpp_regex_traits.hpp @@ -69,7 +69,7 @@ namespace boost{ template class cpp_regex_traits; -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ // // class parser_buf: @@ -290,7 +290,7 @@ void cpp_regex_traits_char_layer::init() { std::string m("Unable to open message catalog: "); std::runtime_error err(m + cat_name); - boost::re_detail::raise_runtime_error(err); + boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); } } // @@ -718,7 +718,7 @@ void cpp_regex_traits_implementation::init() { std::string m("Unable to open message catalog: "); std::runtime_error err(m + cat_name); - boost::re_detail::raise_runtime_error(err); + boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); } } // @@ -774,22 +774,22 @@ void cpp_regex_traits_implementation::init() #else static const char_class_type masks[16] = { - ::boost::re_detail::char_class_alnum, - ::boost::re_detail::char_class_alpha, - ::boost::re_detail::char_class_cntrl, - ::boost::re_detail::char_class_digit, - ::boost::re_detail::char_class_graph, - ::boost::re_detail::char_class_horizontal_space, - ::boost::re_detail::char_class_lower, - ::boost::re_detail::char_class_print, - ::boost::re_detail::char_class_punct, - ::boost::re_detail::char_class_space, - ::boost::re_detail::char_class_upper, - ::boost::re_detail::char_class_vertical_space, - ::boost::re_detail::char_class_xdigit, - ::boost::re_detail::char_class_blank, - ::boost::re_detail::char_class_word, - ::boost::re_detail::char_class_unicode, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_alpha, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_cntrl, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_digit, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_graph, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_horizontal_space, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_lower, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_print, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_punct, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_space, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_upper, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_vertical_space, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_xdigit, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_blank, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_word, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_unicode, }; #endif static const string_type null_string; @@ -804,7 +804,7 @@ void cpp_regex_traits_implementation::init() // // get the collation format used by m_pcollate: // - m_collate_type = re_detail::find_sort_syntax(this, &m_collate_delim); + m_collate_type = BOOST_REGEX_DETAIL_NS::find_sort_syntax(this, &m_collate_delim); } template @@ -841,27 +841,27 @@ typename cpp_regex_traits_implementation::char_class_type static const char_class_type masks[22] = { 0, - ::boost::re_detail::char_class_alnum, - ::boost::re_detail::char_class_alpha, - ::boost::re_detail::char_class_blank, - ::boost::re_detail::char_class_cntrl, - ::boost::re_detail::char_class_digit, - ::boost::re_detail::char_class_digit, - ::boost::re_detail::char_class_graph, - ::boost::re_detail::char_class_horizontal_space, - ::boost::re_detail::char_class_lower, - ::boost::re_detail::char_class_lower, - ::boost::re_detail::char_class_print, - ::boost::re_detail::char_class_punct, - ::boost::re_detail::char_class_space, - ::boost::re_detail::char_class_space, - ::boost::re_detail::char_class_upper, - ::boost::re_detail::char_class_unicode, - ::boost::re_detail::char_class_upper, - ::boost::re_detail::char_class_vertical_space, - ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word, - ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word, - ::boost::re_detail::char_class_xdigit, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_alpha, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_blank, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_cntrl, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_digit, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_digit, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_graph, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_horizontal_space, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_lower, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_lower, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_print, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_punct, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_space, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_space, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_upper, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_unicode, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_upper, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_vertical_space, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum | ::boost::BOOST_REGEX_DETAIL_NS::char_class_word, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum | ::boost::BOOST_REGEX_DETAIL_NS::char_class_word, + ::boost::BOOST_REGEX_DETAIL_NS::char_class_xdigit, }; #endif if(m_custom_class_names.size()) @@ -871,7 +871,7 @@ typename cpp_regex_traits_implementation::char_class_type if(pos != m_custom_class_names.end()) return pos->second; } - std::size_t state_id = 1 + re_detail::get_default_class_id(p1, p2); + std::size_t state_id = 1 + BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2); BOOST_ASSERT(state_id < sizeof(masks) / sizeof(masks[0])); return masks[state_id]; } @@ -881,20 +881,20 @@ template bool cpp_regex_traits_implementation::isctype(const charT c, char_class_type mask) const { return - ((mask & ::boost::re_detail::char_class_space) && (this->m_pctype->is(std::ctype::space, c))) - || ((mask & ::boost::re_detail::char_class_print) && (this->m_pctype->is(std::ctype::print, c))) - || ((mask & ::boost::re_detail::char_class_cntrl) && (this->m_pctype->is(std::ctype::cntrl, c))) - || ((mask & ::boost::re_detail::char_class_upper) && (this->m_pctype->is(std::ctype::upper, c))) - || ((mask & ::boost::re_detail::char_class_lower) && (this->m_pctype->is(std::ctype::lower, c))) - || ((mask & ::boost::re_detail::char_class_alpha) && (this->m_pctype->is(std::ctype::alpha, c))) - || ((mask & ::boost::re_detail::char_class_digit) && (this->m_pctype->is(std::ctype::digit, c))) - || ((mask & ::boost::re_detail::char_class_punct) && (this->m_pctype->is(std::ctype::punct, c))) - || ((mask & ::boost::re_detail::char_class_xdigit) && (this->m_pctype->is(std::ctype::xdigit, c))) - || ((mask & ::boost::re_detail::char_class_blank) && (this->m_pctype->is(std::ctype::space, c)) && !::boost::re_detail::is_separator(c)) - || ((mask & ::boost::re_detail::char_class_word) && (c == '_')) - || ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c)) - || ((mask & ::boost::re_detail::char_class_vertical_space) && (is_separator(c) || (c == '\v'))) - || ((mask & ::boost::re_detail::char_class_horizontal_space) && this->m_pctype->is(std::ctype::space, c) && !(is_separator(c) || (c == '\v'))); + ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_space) && (this->m_pctype->is(std::ctype::space, c))) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_print) && (this->m_pctype->is(std::ctype::print, c))) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_cntrl) && (this->m_pctype->is(std::ctype::cntrl, c))) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_upper) && (this->m_pctype->is(std::ctype::upper, c))) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_lower) && (this->m_pctype->is(std::ctype::lower, c))) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_alpha) && (this->m_pctype->is(std::ctype::alpha, c))) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_digit) && (this->m_pctype->is(std::ctype::digit, c))) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_punct) && (this->m_pctype->is(std::ctype::punct, c))) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_xdigit) && (this->m_pctype->is(std::ctype::xdigit, c))) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_blank) && (this->m_pctype->is(std::ctype::space, c)) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c)) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_word) && (c == '_')) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_unicode) && ::boost::BOOST_REGEX_DETAIL_NS::is_extended(c)) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_vertical_space) && (is_separator(c) || (c == '\v'))) + || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_horizontal_space) && this->m_pctype->is(std::ctype::space, c) && !(is_separator(c) || (c == '\v'))); } #endif @@ -906,7 +906,7 @@ inline boost::shared_ptr > create_c return ::boost::object_cache, cpp_regex_traits_implementation >::get(key, 5); } -} // re_detail +} // BOOST_REGEX_DETAIL_NS template class cpp_regex_traits @@ -923,7 +923,7 @@ public: struct boost_extensions_tag{}; cpp_regex_traits() - : m_pimpl(re_detail::create_cpp_regex_traits(std::locale())) + : m_pimpl(BOOST_REGEX_DETAIL_NS::create_cpp_regex_traits(std::locale())) { } static size_type length(const char_type* p) { @@ -996,19 +996,19 @@ public: && (m_pimpl->m_pctype->is( static_cast(f & mask_base), c))) return true; - else if((f & re_detail::cpp_regex_traits_implementation::mask_unicode) && re_detail::is_extended(c)) + else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation::mask_unicode) && BOOST_REGEX_DETAIL_NS::is_extended(c)) return true; - else if((f & re_detail::cpp_regex_traits_implementation::mask_word) && (c == '_')) + else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation::mask_word) && (c == '_')) return true; - else if((f & re_detail::cpp_regex_traits_implementation::mask_blank) + else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation::mask_blank) && m_pimpl->m_pctype->is(std::ctype::space, c) - && !re_detail::is_separator(c)) + && !BOOST_REGEX_DETAIL_NS::is_separator(c)) return true; - else if((f & re_detail::cpp_regex_traits_implementation::mask_vertical) - && (::boost::re_detail::is_separator(c) || (c == '\v'))) + else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation::mask_vertical) + && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == '\v'))) return true; - else if((f & re_detail::cpp_regex_traits_implementation::mask_horizontal) - && this->isctype(c, std::ctype::space) && !this->isctype(c, re_detail::cpp_regex_traits_implementation::mask_vertical)) + else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation::mask_horizontal) + && this->isctype(c, std::ctype::space) && !this->isctype(c, BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation::mask_vertical)) return true; #ifdef __CYGWIN__ // @@ -1036,7 +1036,7 @@ public: locale_type imbue(locale_type l) { std::locale result(getloc()); - m_pimpl = re_detail::create_cpp_regex_traits(l); + m_pimpl = BOOST_REGEX_DETAIL_NS::create_cpp_regex_traits(l); return result; } locale_type getloc()const @@ -1056,7 +1056,7 @@ public: static std::string get_catalog_name(); private: - boost::shared_ptr > m_pimpl; + boost::shared_ptr > m_pimpl; // // catalog name handler: // @@ -1071,7 +1071,7 @@ private: template int cpp_regex_traits::toi(const charT*& first, const charT* last, int radix)const { - re_detail::parser_buf sbuf; // buffer for parsing numbers. + BOOST_REGEX_DETAIL_NS::parser_buf sbuf; // buffer for parsing numbers. std::basic_istream is(&sbuf); // stream for parsing numbers. // we do NOT want to parse any thousands separators inside the stream: diff --git a/include/boost/regex/v4/cregex.hpp b/include/boost/regex/v4/cregex.hpp index 7b3df1e5..67abfbee 100644 --- a/include/boost/regex/v4/cregex.hpp +++ b/include/boost/regex/v4/cregex.hpp @@ -221,7 +221,7 @@ namespace boost{ class RegEx; -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ class RegExData; struct pred1; @@ -229,7 +229,7 @@ struct pred2; struct pred3; struct pred4; -} /* namespace re_detail */ +} /* namespace BOOST_REGEX_DETAIL_NS */ #if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_DISABLE_WIN32) typedef bool (__cdecl *GrepCallback)(const RegEx& expression); @@ -244,7 +244,7 @@ typedef bool (*FindFilesCallback)(const char* file); class BOOST_REGEX_DECL RegEx { private: - re_detail::RegExData* pdata; + BOOST_REGEX_DETAIL_NS::RegExData* pdata; public: RegEx(); RegEx(const RegEx& o); @@ -296,10 +296,10 @@ public: static const std::size_t npos; - friend struct re_detail::pred1; - friend struct re_detail::pred2; - friend struct re_detail::pred3; - friend struct re_detail::pred4; + friend struct BOOST_REGEX_DETAIL_NS::pred1; + friend struct BOOST_REGEX_DETAIL_NS::pred2; + friend struct BOOST_REGEX_DETAIL_NS::pred3; + friend struct BOOST_REGEX_DETAIL_NS::pred4; }; #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/fileiter.hpp b/include/boost/regex/v4/fileiter.hpp index f13c4b2f..4873a0a8 100644 --- a/include/boost/regex/v4/fileiter.hpp +++ b/include/boost/regex/v4/fileiter.hpp @@ -49,7 +49,7 @@ #include namespace boost{ - namespace re_detail{ + namespace BOOST_REGEX_DETAIL_NS{ #ifndef BOOST_NO_ANSI_APIS typedef WIN32_FIND_DATAA _fi_find_data; @@ -58,7 +58,7 @@ typedef WIN32_FIND_DATAW _fi_find_data; #endif typedef HANDLE _fi_find_handle; - } // namespace re_detail + } // namespace BOOST_REGEX_DETAIL_NS } // namespace boost @@ -84,7 +84,7 @@ using std::list; #endif namespace boost{ - namespace re_detail{ + namespace BOOST_REGEX_DETAIL_NS{ #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX @@ -110,7 +110,7 @@ bool _fi_FindClose(_fi_find_handle hFindFile); # include BOOST_ABI_SUFFIX #endif - } // namespace re_detail + } // namespace BOOST_REGEX_DETAIL_NS } // namespace boost #ifdef FindFirstFile @@ -130,7 +130,7 @@ bool _fi_FindClose(_fi_find_handle hFindFile); #endif namespace boost{ - namespace re_detail{ + namespace BOOST_REGEX_DETAIL_NS{ #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX @@ -427,10 +427,10 @@ inline bool operator < (const directory_iterator&, const directory_iterator&) #endif -} // namespace re_detail -using boost::re_detail::directory_iterator; -using boost::re_detail::file_iterator; -using boost::re_detail::mapfile; +} // namespace BOOST_REGEX_DETAIL_NS +using boost::BOOST_REGEX_DETAIL_NS::directory_iterator; +using boost::BOOST_REGEX_DETAIL_NS::file_iterator; +using boost::BOOST_REGEX_DETAIL_NS::mapfile; } // namespace boost #endif // BOOST_REGEX_NO_FILEITER diff --git a/include/boost/regex/v4/instances.hpp b/include/boost/regex/v4/instances.hpp index 6fa811d2..87447dea 100644 --- a/include/boost/regex/v4/instances.hpp +++ b/include/boost/regex/v4/instances.hpp @@ -54,7 +54,7 @@ namespace boost{ template class BOOST_REGEX_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >; template class BOOST_REGEX_DECL match_results< const BOOST_REGEX_CHAR_T* >; #ifndef BOOST_NO_STD_ALLOCATOR -template class BOOST_REGEX_DECL ::boost::re_detail::perl_matcher::allocator_type BOOST_REGEX_TRAITS_T >; +template class BOOST_REGEX_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher::allocator_type BOOST_REGEX_TRAITS_T >; #endif # ifndef BOOST_REGEX_INSTANTIATE @@ -94,7 +94,7 @@ template class BOOST_REGEX_TEMPLATE_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_R template class BOOST_REGEX_TEMPLATE_DECL match_results< const BOOST_REGEX_CHAR_T* >; #ifndef BOOST_NO_STD_ALLOCATOR -template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher::allocator_type BOOST_REGEX_TRAITS_T >; +template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher::allocator_type BOOST_REGEX_TRAITS_T >; #endif #if !(defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB <= 1))\ && !(defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION <= 800))\ @@ -102,7 +102,7 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher::const_iterator >; #ifndef BOOST_NO_STD_ALLOCATOR -template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std::basic_string::const_iterator, match_results< std::basic_string::const_iterator >::allocator_type, boost::regex_traits >; +template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher< std::basic_string::const_iterator, match_results< std::basic_string::const_iterator >::allocator_type, boost::regex_traits >; #endif #endif @@ -128,7 +128,7 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std:: # endif #if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_REGEX_ICU_INSTANCES) -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template BOOST_REGEX_DECL std::locale cpp_regex_traits_base::imbue(const std::locale& l); @@ -177,7 +177,7 @@ template BOOST_REGEX_DECL void BOOST_REGEX_CALL match_results::maybe_assign( const match_results& m); -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template BOOST_REGEX_DECL void perl_matcher::allocator_type BOOST_REGEX_TRAITS_T >::construct_init( const basic_regex& e, match_flag_type f); template BOOST_REGEX_DECL bool perl_matcher::allocator_type BOOST_REGEX_TRAITS_T >::match(); @@ -193,7 +193,7 @@ template BOOST_REGEX_DECL void BOOST_REGEX_CALL match_results::const_iterator>::maybe_assign( const match_results::const_iterator>& m); -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template BOOST_REGEX_DECL void perl_matcher::const_iterator, match_results< std::basic_string::const_iterator >::allocator_type, boost::regex_traits >::construct_init( const basic_regex& e, match_flag_type f); template BOOST_REGEX_DECL bool perl_matcher::const_iterator, match_results< std::basic_string::const_iterator >::allocator_type, boost::regex_traits >::match(); diff --git a/include/boost/regex/v4/iterator_traits.hpp b/include/boost/regex/v4/iterator_traits.hpp index 53e13760..ae45ecb8 100644 --- a/include/boost/regex/v4/iterator_traits.hpp +++ b/include/boost/regex/v4/iterator_traits.hpp @@ -31,7 +31,7 @@ #endif namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ #if defined(BOOST_NO_STD_ITERATOR_TRAITS) @@ -117,7 +117,7 @@ struct regex_iterator_traits : public std::iterator_traits {}; #endif -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS } // namespace boost #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/match_results.hpp b/include/boost/regex/v4/match_results.hpp index 3e79b7a7..c8233bdd 100644 --- a/include/boost/regex/v4/match_results.hpp +++ b/include/boost/regex/v4/match_results.hpp @@ -39,7 +39,7 @@ namespace boost{ # endif #endif -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ class named_subexpressions; @@ -64,14 +64,14 @@ public: typedef const_reference reference; typedef typename vector_type::const_iterator const_iterator; typedef const_iterator iterator; - typedef typename re_detail::regex_iterator_traits< + typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits< BidiIterator>::difference_type difference_type; typedef typename Allocator::size_type size_type; typedef Allocator allocator_type; - typedef typename re_detail::regex_iterator_traits< + typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits< BidiIterator>::value_type char_type; typedef std::basic_string string_type; - typedef re_detail::named_subexpressions named_sub_type; + typedef BOOST_REGEX_DETAIL_NS::named_subexpressions named_sub_type; // construct/copy/destroy: explicit match_results(const Allocator& a = Allocator()) @@ -158,7 +158,7 @@ public: const sub_match& s = m_subs[sub]; if(s.matched || (sub == 2)) { - return ::boost::re_detail::distance((BidiIterator)(m_base), (BidiIterator)(s.first)); + return ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)(m_base), (BidiIterator)(s.first)); } } return ~static_cast(0); @@ -237,7 +237,7 @@ public: // if(m_is_singular) raise_logic_error(); - re_detail::named_subexpressions::range_type r = m_named_subs->equal_range(i, j); + BOOST_REGEX_DETAIL_NS::named_subexpressions::range_type r = m_named_subs->equal_range(i, j); while((r.first != r.second) && ((*this)[r.first->index].matched == false)) ++r.first; return r.first != r.second ? (*this)[r.first->index] : m_null; @@ -262,7 +262,7 @@ public: // if(m_is_singular) raise_logic_error(); - re_detail::named_subexpressions::range_type s, r; + BOOST_REGEX_DETAIL_NS::named_subexpressions::range_type s, r; s = r = m_named_subs->equal_range(i, j); while((r.first != r.second) && ((*this)[r.first->index].matched == false)) ++r.first; @@ -345,7 +345,7 @@ public: { if(m_is_singular) raise_logic_error(); - typedef typename re_detail::compute_functor_type, OutputIterator>::type F; + typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type, OutputIterator>::type F; F func(fmt); return func(*this, out, flags); } @@ -355,9 +355,9 @@ public: if(m_is_singular) raise_logic_error(); std::basic_string result; - re_detail::string_out_iterator > i(result); + BOOST_REGEX_DETAIL_NS::string_out_iterator > i(result); - typedef typename re_detail::compute_functor_type, re_detail::string_out_iterator > >::type F; + typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type, BOOST_REGEX_DETAIL_NS::string_out_iterator > >::type F; F func(fmt); func(*this, i, flags); @@ -373,7 +373,7 @@ public: if(m_is_singular) raise_logic_error(); typedef ::boost::regex_traits_wrapper traits_type; - typedef typename re_detail::compute_functor_type, OutputIterator, traits_type>::type F; + typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type, OutputIterator, traits_type>::type F; F func(fmt); return func(*this, out, flags, re.get_traits()); } @@ -386,9 +386,9 @@ public: raise_logic_error(); typedef ::boost::regex_traits_wrapper traits_type; std::basic_string result; - re_detail::string_out_iterator > i(result); + BOOST_REGEX_DETAIL_NS::string_out_iterator > i(result); - typedef typename re_detail::compute_functor_type, re_detail::string_out_iterator >, traits_type >::type F; + typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type, BOOST_REGEX_DETAIL_NS::string_out_iterator >, traits_type >::type F; F func(fmt); func(*this, i, flags, re.get_traits()); @@ -639,15 +639,15 @@ void BOOST_REGEX_CALL match_results::maybe_assign(const // p1 better than p2, and no need to calculate distances: return; } - base1 = ::boost::re_detail::distance(l_base, p1->first); - base2 = ::boost::re_detail::distance(l_base, p2->first); + base1 = ::boost::BOOST_REGEX_DETAIL_NS::distance(l_base, p1->first); + base2 = ::boost::BOOST_REGEX_DETAIL_NS::distance(l_base, p2->first); BOOST_ASSERT(base1 >= 0); BOOST_ASSERT(base2 >= 0); if(base1 < base2) return; if(base2 < base1) break; - len1 = ::boost::re_detail::distance((BidiIterator)p1->first, (BidiIterator)p1->second); - len2 = ::boost::re_detail::distance((BidiIterator)p2->first, (BidiIterator)p2->second); + len1 = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)p1->first, (BidiIterator)p1->second); + len2 = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)p2->first, (BidiIterator)p2->second); BOOST_ASSERT(len1 >= 0); BOOST_ASSERT(len2 >= 0); if((len1 != len2) || ((p1->matched == false) && (p2->matched == true))) diff --git a/include/boost/regex/v4/mem_block_cache.hpp b/include/boost/regex/v4/mem_block_cache.hpp index 222142dd..dc549150 100644 --- a/include/boost/regex/v4/mem_block_cache.hpp +++ b/include/boost/regex/v4/mem_block_cache.hpp @@ -28,7 +28,7 @@ #endif namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ struct mem_block_node { diff --git a/include/boost/regex/v4/perl_matcher.hpp b/include/boost/regex/v4/perl_matcher.hpp index e21f093d..d90418f5 100644 --- a/include/boost/regex/v4/perl_matcher.hpp +++ b/include/boost/regex/v4/perl_matcher.hpp @@ -31,7 +31,7 @@ #endif namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ // // error checking API: @@ -561,7 +561,7 @@ private: #pragma warning(pop) #endif -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS #ifdef BOOST_MSVC #pragma warning(push) diff --git a/include/boost/regex/v4/perl_matcher_common.hpp b/include/boost/regex/v4/perl_matcher_common.hpp index 480d8f14..2f4109d6 100644 --- a/include/boost/regex/v4/perl_matcher_common.hpp +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -40,7 +40,7 @@ #endif namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template void perl_matcher::construct_init(const basic_regex& e, match_flag_type f) @@ -84,7 +84,7 @@ void perl_matcher::construct_init(const basic_r // find the value to use for matching word boundaries: m_word_mask = re.get_data().m_word_mask; // find bitmask to use for matching '.': - match_any_mask = static_cast((f & match_not_dot_newline) ? re_detail::test_not_newline : re_detail::test_newline); + match_any_mask = static_cast((f & match_not_dot_newline) ? BOOST_REGEX_DETAIL_NS::test_not_newline : BOOST_REGEX_DETAIL_NS::test_newline); } template @@ -101,7 +101,7 @@ void perl_matcher::estimate_max_state_count(std // Calculate NS^2 first: // static const std::ptrdiff_t k = 100000; - std::ptrdiff_t dist = boost::re_detail::distance(base, last); + std::ptrdiff_t dist = boost::BOOST_REGEX_DETAIL_NS::distance(base, last); if(dist == 0) dist = 1; std::ptrdiff_t states = re.size(); @@ -165,7 +165,7 @@ template inline bool perl_matcher::protected_call( protected_proc_type proc) { - ::boost::re_detail::concrete_protected_call + ::boost::BOOST_REGEX_DETAIL_NS::concrete_protected_call > obj(this, proc); return obj.execute(); @@ -703,7 +703,7 @@ bool perl_matcher::match_backstep() #endif if( ::boost::is_random_access_iterator::value) { - std::ptrdiff_t maxlen = ::boost::re_detail::distance(backstop, position); + std::ptrdiff_t maxlen = ::boost::BOOST_REGEX_DETAIL_NS::distance(backstop, position); if(maxlen < static_cast(pstate)->index) return false; std::advance(position, -static_cast(pstate)->index); @@ -966,7 +966,7 @@ bool perl_matcher::find_restart_lit() return false; } -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS } // namespace boost diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp index 07e93411..be3d53a9 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -38,7 +38,7 @@ #endif namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template inline void inplace_destroy(T* p) @@ -652,7 +652,7 @@ bool perl_matcher::match_dot_repeat_fast() const re_repeat* rep = static_cast(pstate); bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent); - unsigned count = static_cast((std::min)(static_cast(::boost::re_detail::distance(position, last)), static_cast(greedy ? rep->max : rep->min))); + unsigned count = static_cast((std::min)(static_cast(::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)), static_cast(greedy ? rep->max : rep->min))); if(rep->min > count) { position = last; @@ -705,7 +705,7 @@ bool perl_matcher::match_char_repeat() BidiIterator end = position; // Move end forward by "desired", preferably without using distance or advance if we can // as these can be slow for some iterator types. - std::size_t len = (desired == (std::numeric_limits::max)()) ? 0u : ::boost::re_detail::distance(position, last); + std::size_t len = (desired == (std::numeric_limits::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last); if(desired >= len) end = last; else @@ -715,7 +715,7 @@ bool perl_matcher::match_char_repeat() { ++position; } - count = (unsigned)::boost::re_detail::distance(origin, position); + count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position); } else { @@ -779,7 +779,7 @@ bool perl_matcher::match_set_repeat() BidiIterator end = position; // Move end forward by "desired", preferably without using distance or advance if we can // as these can be slow for some iterator types. - std::size_t len = (desired == (std::numeric_limits::max)()) ? 0u : ::boost::re_detail::distance(position, last); + std::size_t len = (desired == (std::numeric_limits::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last); if(desired >= len) end = last; else @@ -789,7 +789,7 @@ bool perl_matcher::match_set_repeat() { ++position; } - count = (unsigned)::boost::re_detail::distance(origin, position); + count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position); } else { @@ -854,7 +854,7 @@ bool perl_matcher::match_long_set_repeat() BidiIterator end = position; // Move end forward by "desired", preferably without using distance or advance if we can // as these can be slow for some iterator types. - std::size_t len = (desired == (std::numeric_limits::max)()) ? 0u : ::boost::re_detail::distance(position, last); + std::size_t len = (desired == (std::numeric_limits::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last); if(desired >= len) end = last; else @@ -864,7 +864,7 @@ bool perl_matcher::match_long_set_repeat() { ++position; } - count = (unsigned)::boost::re_detail::distance(origin, position); + count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position); } else { @@ -1077,14 +1077,14 @@ bool perl_matcher::unwind_paren(bool have_match #endif // unwind stack: m_backup_state = pmp+1; - boost::re_detail::inplace_destroy(pmp); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp); return true; // keep looking } template bool perl_matcher::unwind_recursion_stopper(bool) { - boost::re_detail::inplace_destroy(m_backup_state++); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(m_backup_state++); pstate = 0; // nothing left to search return false; // end of stack nothing more to search } @@ -1097,7 +1097,7 @@ bool perl_matcher::unwind_assertion(bool r) position = pmp->position; bool result = (r == pmp->positive); m_recursive_result = pmp->positive ? r : !r; - boost::re_detail::inplace_destroy(pmp++); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++); m_backup_state = pmp; return !result; // return false if the assertion was matched to stop search. } @@ -1111,7 +1111,7 @@ bool perl_matcher::unwind_alt(bool r) pstate = pmp->pstate; position = pmp->position; } - boost::re_detail::inplace_destroy(pmp++); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++); m_backup_state = pmp; return r; } @@ -1120,7 +1120,7 @@ template bool perl_matcher::unwind_repeater_counter(bool) { saved_repeater* pmp = static_cast*>(m_backup_state); - boost::re_detail::inplace_destroy(pmp++); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++); m_backup_state = pmp; return true; // keep looking } @@ -1132,7 +1132,7 @@ bool perl_matcher::unwind_extra_block(bool) void* condemmed = m_stack_base; m_stack_base = pmp->base; m_backup_state = pmp->end; - boost::re_detail::inplace_destroy(pmp); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp); put_mem_block(condemmed); return true; // keep looking } @@ -1141,7 +1141,7 @@ template inline void perl_matcher::destroy_single_repeat() { saved_single_repeat* p = static_cast*>(m_backup_state); - boost::re_detail::inplace_destroy(p++); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(p++); m_backup_state = p; } @@ -1533,7 +1533,7 @@ bool perl_matcher::unwind_non_greedy_repeat(boo pstate = pmp->pstate; ++(*next_count); } - boost::re_detail::inplace_destroy(pmp++); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++); m_backup_state = pmp; return r; } @@ -1549,7 +1549,7 @@ bool perl_matcher::unwind_recursion(bool r) recursion_stack.back().preturn_address = pmp->preturn_address; recursion_stack.back().results = pmp->results; } - boost::re_detail::inplace_destroy(pmp++); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++); m_backup_state = pmp; return true; } @@ -1562,7 +1562,7 @@ bool perl_matcher::unwind_recursion_pop(bool r) { recursion_stack.pop_back(); } - boost::re_detail::inplace_destroy(pmp++); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++); m_backup_state = pmp; return true; } @@ -1590,7 +1590,7 @@ bool perl_matcher::unwind_parenthesis_pop(bool { --parenthesis_stack_position; } - boost::re_detail::inplace_destroy(pmp++); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++); m_backup_state = pmp; return true; } @@ -1618,7 +1618,7 @@ bool perl_matcher::unwind_parenthesis_push(bool { parenthesis_stack[parenthesis_stack_position++] = pmp->position; } - boost::re_detail::inplace_destroy(pmp++); + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++); m_backup_state = pmp; return true; } @@ -1638,7 +1638,7 @@ inline void perl_matcher::push_parenthesis_push m_backup_state = pmp; } */ -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS } // namespace boost #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/perl_matcher_recursive.hpp b/include/boost/regex/v4/perl_matcher_recursive.hpp index 9ed5af18..ea912402 100644 --- a/include/boost/regex/v4/perl_matcher_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_recursive.hpp @@ -37,7 +37,7 @@ #endif namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template class backup_subex @@ -472,7 +472,7 @@ bool perl_matcher::match_dot_repeat_fast() #pragma warning(disable:4267) #endif bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent); - std::size_t count = (std::min)(static_cast(::boost::re_detail::distance(position, last)), static_cast(greedy ? rep->max : rep->min)); + std::size_t count = (std::min)(static_cast(::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)), static_cast(greedy ? rep->max : rep->min)); if(rep->min > count) { position = last; @@ -539,7 +539,7 @@ bool perl_matcher::match_char_repeat() desired = (std::min)( (std::size_t)(greedy ? rep->max : rep->min), - (std::size_t)::boost::re_detail::distance(position, last)); + (std::size_t)::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)); count = desired; ++desired; if(icase) @@ -643,7 +643,7 @@ bool perl_matcher::match_set_repeat() BidiIterator end = position; // Move end forward by "desired", preferably without using distance or advance if we can // as these can be slow for some iterator types. - std::size_t len = (desired == (std::numeric_limits::max)()) ? 0u : ::boost::re_detail::distance(position, last); + std::size_t len = (desired == (std::numeric_limits::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last); if(desired >= len) end = last; else @@ -653,7 +653,7 @@ bool perl_matcher::match_set_repeat() { ++position; } - count = (unsigned)::boost::re_detail::distance(origin, position); + count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position); } else { @@ -739,7 +739,7 @@ bool perl_matcher::match_long_set_repeat() BidiIterator end = position; // Move end forward by "desired", preferably without using distance or advance if we can // as these can be slow for some iterator types. - std::size_t len = (desired == (std::numeric_limits::max)()) ? 0u : ::boost::re_detail::distance(position, last); + std::size_t len = (desired == (std::numeric_limits::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last); if(desired >= len) end = last; else @@ -749,7 +749,7 @@ bool perl_matcher::match_long_set_repeat() { ++position; } - count = (unsigned)::boost::re_detail::distance(origin, position); + count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position); } else { @@ -982,7 +982,7 @@ bool perl_matcher::match_match() -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS } // namespace boost #ifdef BOOST_MSVC #pragma warning(pop) diff --git a/include/boost/regex/v4/primary_transform.hpp b/include/boost/regex/v4/primary_transform.hpp index 989f500c..3e7cac54 100644 --- a/include/boost/regex/v4/primary_transform.hpp +++ b/include/boost/regex/v4/primary_transform.hpp @@ -32,7 +32,7 @@ #endif namespace boost{ - namespace re_detail{ + namespace BOOST_REGEX_DETAIL_NS{ enum{ @@ -122,7 +122,7 @@ unsigned find_sort_syntax(const traits* pt, charT* delim) } - } // namespace re_detail + } // namespace BOOST_REGEX_DETAIL_NS } // namespace boost #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/protected_call.hpp b/include/boost/regex/v4/protected_call.hpp index ebf15ba3..9d47514f 100644 --- a/include/boost/regex/v4/protected_call.hpp +++ b/include/boost/regex/v4/protected_call.hpp @@ -32,7 +32,7 @@ #endif namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ class BOOST_REGEX_DECL abstract_protected_call { diff --git a/include/boost/regex/v4/regex_format.hpp b/include/boost/regex/v4/regex_format.hpp index a34c40ad..e9006a7b 100644 --- a/include/boost/regex/v4/regex_format.hpp +++ b/include/boost/regex/v4/regex_format.hpp @@ -55,7 +55,7 @@ namespace boost{ template >::allocator_type > class match_results; -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ // // struct trivial_format_traits: @@ -73,11 +73,11 @@ struct trivial_format_traits } static charT tolower(charT c) { - return ::boost::re_detail::global_lower(c); + return ::boost::BOOST_REGEX_DETAIL_NS::global_lower(c); } static charT toupper(charT c) { - return ::boost::re_detail::global_upper(c); + return ::boost::BOOST_REGEX_DETAIL_NS::global_upper(c); } static int value(const charT c, int radix) { @@ -359,7 +359,7 @@ void basic_regex_formatter::format default: // see if we have a number: { - std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end); + std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end); //len = (std::min)(static_cast(2), len); int v = this->toi(m_position, m_position + len, 10); if((v < 0) || (have_brace && ((m_position == m_end) || (*m_position != '}')))) @@ -570,7 +570,7 @@ void basic_regex_formatter::format } else { - std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end); + std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end); len = (std::min)(static_cast(2), len); int val = this->toi(m_position, m_position + len, 16); if(val < 0) @@ -634,7 +634,7 @@ void basic_regex_formatter::format break; } // see if we have a \n sed style backreference: - std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end); + std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end); len = (std::min)(static_cast(1), len); int v = this->toi(m_position, m_position+len, 10); if((v > 0) || ((v == 0) && (m_flags & ::boost::regex_constants::format_sed))) @@ -646,7 +646,7 @@ void basic_regex_formatter::format { // octal ecape sequence: --m_position; - len = ::boost::re_detail::distance(m_position, m_end); + len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end); len = (std::min)(static_cast(4), len); v = this->toi(m_position, m_position + len, 8); BOOST_ASSERT(v >= 0); @@ -693,7 +693,7 @@ void basic_regex_formatter::format } else { - std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end); + std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end); len = (std::min)(static_cast(2), len); v = this->toi(m_position, m_position + len, 10); } @@ -835,10 +835,10 @@ OutputIterator regex_format_imp(OutputIterator out, { if(flags & regex_constants::format_literal) { - return re_detail::copy(p1, p2, out); + return BOOST_REGEX_DETAIL_NS::copy(p1, p2, out); } - re_detail::basic_regex_formatter< + BOOST_REGEX_DETAIL_NS::basic_regex_formatter< OutputIterator, match_results, traits, ForwardIter> f(out, m, t); @@ -1028,7 +1028,7 @@ struct format_functor1 template OutputIter do_format_string(const S& s, OutputIter i) { - return re_detail::copy(s.begin(), s.end(), i); + return BOOST_REGEX_DETAIL_NS::copy(s.begin(), s.end(), i); } template inline OutputIter do_format_string(const S* s, OutputIter i) @@ -1085,7 +1085,7 @@ struct format_functor_container OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits& t = Traits()) { //typedef typename Match::char_type char_type; - return re_detail::regex_format_imp(i, m, func.begin(), func.end(), f, t); + return BOOST_REGEX_DETAIL_NS::regex_format_imp(i, m, func.begin(), func.end(), f, t); } private: const Container& func; @@ -1093,7 +1093,7 @@ private: format_functor_container& operator=(const format_functor_container&); }; -template > +template > struct compute_functor_type { typedef typename format_traits::type tag; @@ -1114,7 +1114,7 @@ struct compute_functor_type >::type type; }; -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS template inline OutputIterator regex_format(OutputIterator out, diff --git a/include/boost/regex/v4/regex_grep.hpp b/include/boost/regex/v4/regex_grep.hpp index 3a3d906e..c5cb054e 100644 --- a/include/boost/regex/v4/regex_grep.hpp +++ b/include/boost/regex/v4/regex_grep.hpp @@ -50,7 +50,7 @@ inline unsigned int regex_grep(Predicate foo, typedef typename match_results::allocator_type match_allocator_type; match_results m; - re_detail::perl_matcher matcher(first, last, m, e, flags, first); + BOOST_REGEX_DETAIL_NS::perl_matcher matcher(first, last, m, e, flags, first); unsigned int count = 0; while(matcher.find()) { diff --git a/include/boost/regex/v4/regex_iterator.hpp b/include/boost/regex/v4/regex_iterator.hpp index 09e75c69..0d10a1b9 100644 --- a/include/boost/regex/v4/regex_iterator.hpp +++ b/include/boost/regex/v4/regex_iterator.hpp @@ -82,14 +82,14 @@ private: }; template ::value_type, + class charT = BOOST_DEDUCED_TYPENAME BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type, class traits = regex_traits > class regex_iterator #ifndef BOOST_NO_STD_ITERATOR : public std::iterator< std::forward_iterator_tag, match_results, - typename re_detail::regex_iterator_traits::difference_type, + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::difference_type, const match_results*, const match_results& > #endif @@ -100,7 +100,7 @@ private: public: typedef basic_regex regex_type; typedef match_results value_type; - typedef typename re_detail::regex_iterator_traits::difference_type + typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::difference_type difference_type; typedef const value_type* pointer; typedef const value_type& reference; diff --git a/include/boost/regex/v4/regex_match.hpp b/include/boost/regex/v4/regex_match.hpp index e947a152..a50daa2a 100644 --- a/include/boost/regex/v4/regex_match.hpp +++ b/include/boost/regex/v4/regex_match.hpp @@ -46,7 +46,7 @@ bool regex_match(BidiIterator first, BidiIterator last, const basic_regex& e, match_flag_type flags = match_default) { - re_detail::perl_matcher matcher(first, last, m, e, flags, first); + BOOST_REGEX_DETAIL_NS::perl_matcher matcher(first, last, m, e, flags, first); return matcher.match(); } template diff --git a/include/boost/regex/v4/regex_raw_buffer.hpp b/include/boost/regex/v4/regex_raw_buffer.hpp index c7792e3d..fcdb856a 100644 --- a/include/boost/regex/v4/regex_raw_buffer.hpp +++ b/include/boost/regex/v4/regex_raw_buffer.hpp @@ -29,7 +29,7 @@ #include namespace boost{ - namespace re_detail{ + namespace BOOST_REGEX_DETAIL_NS{ #ifdef BOOST_MSVC #pragma warning(push) @@ -198,7 +198,7 @@ inline raw_storage::raw_storage(size_type n) #pragma warning(pop) #endif -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS } // namespace boost #endif diff --git a/include/boost/regex/v4/regex_replace.hpp b/include/boost/regex/v4/regex_replace.hpp index ac8e3c81..415c58b6 100644 --- a/include/boost/regex/v4/regex_replace.hpp +++ b/include/boost/regex/v4/regex_replace.hpp @@ -48,7 +48,7 @@ OutputIterator regex_replace(OutputIterator out, if(i == j) { if(!(flags & regex_constants::format_no_copy)) - out = re_detail::copy(first, last, out); + out = BOOST_REGEX_DETAIL_NS::copy(first, last, out); } else { @@ -56,7 +56,7 @@ OutputIterator regex_replace(OutputIterator out, while(i != j) { if(!(flags & regex_constants::format_no_copy)) - out = re_detail::copy(i->prefix().first, i->prefix().second, out); + out = BOOST_REGEX_DETAIL_NS::copy(i->prefix().first, i->prefix().second, out); out = i->format(out, fmt, flags, e); last_m = (*i)[0].second; if(flags & regex_constants::format_first_only) @@ -64,7 +64,7 @@ OutputIterator regex_replace(OutputIterator out, ++i; } if(!(flags & regex_constants::format_no_copy)) - out = re_detail::copy(last_m, last, out); + out = BOOST_REGEX_DETAIL_NS::copy(last_m, last, out); } return out; } @@ -76,7 +76,7 @@ std::basic_string regex_replace(const std::basic_string& s, match_flag_type flags = match_default) { std::basic_string result; - re_detail::string_out_iterator > i(result); + BOOST_REGEX_DETAIL_NS::string_out_iterator > i(result); regex_replace(i, s.begin(), s.end(), e, fmt, flags); return result; } diff --git a/include/boost/regex/v4/regex_search.hpp b/include/boost/regex/v4/regex_search.hpp index cf5579d2..0725d3ec 100644 --- a/include/boost/regex/v4/regex_search.hpp +++ b/include/boost/regex/v4/regex_search.hpp @@ -52,7 +52,7 @@ bool regex_search(BidiIterator first, BidiIterator last, if(e.flags() & regex_constants::failbit) return false; - re_detail::perl_matcher matcher(first, last, m, e, flags, base); + BOOST_REGEX_DETAIL_NS::perl_matcher matcher(first, last, m, e, flags, base); return matcher.find(); } @@ -141,7 +141,7 @@ bool regex_search(BidiIterator first, BidiIterator last, match_results m; typedef typename match_results::allocator_type match_alloc_type; - re_detail::perl_matcher matcher(first, last, m, e, flags | regex_constants::match_any, first); + BOOST_REGEX_DETAIL_NS::perl_matcher matcher(first, last, m, e, flags | regex_constants::match_any, first); return matcher.find(); } diff --git a/include/boost/regex/v4/regex_split.hpp b/include/boost/regex/v4/regex_split.hpp index c12d7baa..65b2c64a 100644 --- a/include/boost/regex/v4/regex_split.hpp +++ b/include/boost/regex/v4/regex_split.hpp @@ -39,7 +39,7 @@ namespace boost{ # pragma warning(disable: 4800) #endif -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template const basic_regex& get_default_expression(charT) @@ -97,7 +97,7 @@ bool split_pred::operator() return true; } -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS template std::size_t regex_split(OutputIterator out, @@ -110,7 +110,7 @@ std::size_t regex_split(OutputIterator out, //typedef typename match_results::allocator_type match_allocator; ci_t last = s.begin(); std::size_t init_size = max_split; - re_detail::split_pred pred(&last, &out, &max_split); + BOOST_REGEX_DETAIL_NS::split_pred pred(&last, &out, &max_split); ci_t i, j; i = s.begin(); j = s.end(); @@ -147,7 +147,7 @@ template inline std::size_t regex_split(OutputIterator out, std::basic_string& s) { - return regex_split(out, s, re_detail::get_default_expression(charT(0)), match_default, UINT_MAX); + return regex_split(out, s, BOOST_REGEX_DETAIL_NS::get_default_expression(charT(0)), match_default, UINT_MAX); } #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/regex_token_iterator.hpp b/include/boost/regex/v4/regex_token_iterator.hpp index dbb08037..1d75604b 100644 --- a/include/boost/regex/v4/regex_token_iterator.hpp +++ b/include/boost/regex/v4/regex_token_iterator.hpp @@ -164,14 +164,14 @@ private: }; template ::value_type, + class charT = BOOST_DEDUCED_TYPENAME BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type, class traits = regex_traits > class regex_token_iterator #ifndef BOOST_NO_STD_ITERATOR : public std::iterator< std::forward_iterator_tag, sub_match, - typename re_detail::regex_iterator_traits::difference_type, + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::difference_type, const sub_match*, const sub_match& > #endif @@ -182,7 +182,7 @@ private: public: typedef basic_regex regex_type; typedef sub_match value_type; - typedef typename re_detail::regex_iterator_traits::difference_type + typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::difference_type difference_type; typedef const value_type* pointer; typedef const value_type& reference; diff --git a/include/boost/regex/v4/regex_traits.hpp b/include/boost/regex/v4/regex_traits.hpp index 8b1cb6ff..45a4bdf6 100644 --- a/include/boost/regex/v4/regex_traits.hpp +++ b/include/boost/regex/v4/regex_traits.hpp @@ -82,7 +82,7 @@ struct regex_traits : public implementationT // interfaces that we support, in addition to the // required "standard" ones: // -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ #if !BOOST_WORKAROUND(__HP_aCC, < 60000) BOOST_MPL_HAS_XXX_TRAIT_DEF(boost_extensions_tag) #else @@ -99,7 +99,7 @@ struct default_wrapper : public BaseT typedef typename BaseT::char_type char_type; std::string error_string(::boost::regex_constants::error_type e)const { - return ::boost::re_detail::get_default_error_string(e); + return ::boost::BOOST_REGEX_DETAIL_NS::get_default_error_string(e); } ::boost::regex_constants::syntax_type syntax_type(char_type c)const { @@ -111,7 +111,7 @@ struct default_wrapper : public BaseT } int toi(const char_type*& p1, const char_type* p2, int radix)const { - return ::boost::re_detail::global_toi(p1, p2, radix, *this); + return ::boost::BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this); } char_type translate(char_type c, bool icase)const { @@ -123,11 +123,11 @@ struct default_wrapper : public BaseT } char_type tolower(char_type c)const { - return ::boost::re_detail::global_lower(c); + return ::boost::BOOST_REGEX_DETAIL_NS::global_lower(c); } char_type toupper(char_type c)const { - return ::boost::re_detail::global_upper(c); + return ::boost::BOOST_REGEX_DETAIL_NS::global_upper(c); } }; @@ -157,13 +157,13 @@ struct compute_wrapper_base, false> #endif #endif -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS template struct regex_traits_wrapper - : public ::boost::re_detail::compute_wrapper_base< + : public ::boost::BOOST_REGEX_DETAIL_NS::compute_wrapper_base< BaseT, - ::boost::re_detail::has_boost_extensions_tag::value + ::boost::BOOST_REGEX_DETAIL_NS::has_boost_extensions_tag::value >::type { regex_traits_wrapper(){} diff --git a/include/boost/regex/v4/regex_traits_defaults.hpp b/include/boost/regex/v4/regex_traits_defaults.hpp index a087d784..7445ac58 100644 --- a/include/boost/regex/v4/regex_traits_defaults.hpp +++ b/include/boost/regex/v4/regex_traits_defaults.hpp @@ -30,6 +30,8 @@ #pragma warning(pop) #endif +#include + #ifndef BOOST_REGEX_SYNTAX_TYPE_HPP #include #endif @@ -43,7 +45,7 @@ namespace std{ } #endif -namespace boost{ namespace re_detail{ +namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ // @@ -153,7 +155,7 @@ struct character_pointer_range // calling std::equal, but there is no other algorithm available: // not even a non-standard MS one. So forward to unchecked_equal // in the MS case. - return ((p2 - p1) == (r.p2 - r.p1)) && re_detail::equal(p1, p2, r.p1); + return ((p2 - p1) == (r.p2 - r.p1)) && BOOST_REGEX_DETAIL_NS::equal(p1, p2, r.p1); } }; template @@ -354,7 +356,7 @@ inline const char* get_escape_R_string() #endif } -} // re_detail +} // BOOST_REGEX_DETAIL_NS } // boost #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/regex_workaround.hpp b/include/boost/regex/v4/regex_workaround.hpp index fc57472a..821be608 100644 --- a/include/boost/regex/v4/regex_workaround.hpp +++ b/include/boost/regex/v4/regex_workaround.hpp @@ -42,6 +42,7 @@ #include #include #include +#include #ifndef BOOST_NO_STD_LOCALE # include #endif @@ -52,7 +53,7 @@ namespace std{ } #endif -namespace boost{ namespace re_detail{ +namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ #ifdef BOOST_NO_STD_DISTANCE template std::ptrdiff_t distance(const T& x, const T& y) @@ -94,7 +95,7 @@ namespace std{ ****************************************************************************/ #ifdef __cplusplus -namespace boost{ namespace re_detail{ +namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ #ifdef BOOST_MSVC #pragma warning (push) @@ -123,7 +124,7 @@ inline void pointer_construct(T* p, const T& t) ****************************************************************************/ #ifdef __cplusplus -namespace boost{ namespace re_detail{ +namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ #if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && BOOST_WORKAROUND(BOOST_MSVC, <1600) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) // // MSVC 8 will either emit warnings or else refuse to compile diff --git a/include/boost/regex/v4/states.hpp b/include/boost/regex/v4/states.hpp index 38690b22..5e50f4a8 100644 --- a/include/boost/regex/v4/states.hpp +++ b/include/boost/regex/v4/states.hpp @@ -31,7 +31,7 @@ #endif namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ /*** mask_type ******************************************************* Whenever we have a choice of two alternatives, we use an array of bytes @@ -281,7 +281,7 @@ iterator BOOST_REGEX_CALL re_is_set_member(iterator next, const re_set_long* set_, const regex_data& e, bool icase); -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS } // namespace boost diff --git a/include/boost/regex/v4/sub_match.hpp b/include/boost/regex/v4/sub_match.hpp index bd31d58c..ff8a8e46 100644 --- a/include/boost/regex/v4/sub_match.hpp +++ b/include/boost/regex/v4/sub_match.hpp @@ -35,11 +35,11 @@ namespace boost{ template struct sub_match : public std::pair { - typedef typename re_detail::regex_iterator_traits::value_type value_type; + typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type value_type; #if defined(BOOST_NO_STD_ITERATOR_TRAITS) typedef std::ptrdiff_t difference_type; #else - typedef typename re_detail::regex_iterator_traits::difference_type difference_type; + typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::difference_type difference_type; #endif typedef BidiIterator iterator_type; typedef BidiIterator iterator; @@ -65,7 +65,7 @@ struct sub_match : public std::pair #endif difference_type BOOST_REGEX_CALL length()const { - difference_type n = matched ? ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second) : 0; + difference_type n = matched ? ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)this->first, (BidiIterator)this->second) : 0; return n; } std::basic_string str()const @@ -73,7 +73,7 @@ struct sub_match : public std::pair std::basic_string result; if(matched) { - std::size_t len = ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second); + std::size_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)this->first, (BidiIterator)this->second); result.reserve(len); BidiIterator i = this->first; while(i != this->second) @@ -195,235 +195,235 @@ typedef sub_match wssub_match; // comparison to std::basic_string<> part 1: template -inline bool operator == (const std::basic_string::value_type, traits, Allocator>& s, +inline bool operator == (const std::basic_string::value_type, traits, Allocator>& s, const sub_match& m) { return s.compare(m.str()) == 0; } template -inline bool operator != (const std::basic_string::value_type, traits, Allocator>& s, +inline bool operator != (const std::basic_string::value_type, traits, Allocator>& s, const sub_match& m) { return s.compare(m.str()) != 0; } template -inline bool operator < (const std::basic_string::value_type, traits, Allocator>& s, +inline bool operator < (const std::basic_string::value_type, traits, Allocator>& s, const sub_match& m) { return s.compare(m.str()) < 0; } template -inline bool operator <= (const std::basic_string::value_type, traits, Allocator>& s, +inline bool operator <= (const std::basic_string::value_type, traits, Allocator>& s, const sub_match& m) { return s.compare(m.str()) <= 0; } template -inline bool operator >= (const std::basic_string::value_type, traits, Allocator>& s, +inline bool operator >= (const std::basic_string::value_type, traits, Allocator>& s, const sub_match& m) { return s.compare(m.str()) >= 0; } template -inline bool operator > (const std::basic_string::value_type, traits, Allocator>& s, +inline bool operator > (const std::basic_string::value_type, traits, Allocator>& s, const sub_match& m) { return s.compare(m.str()) > 0; } // comparison to std::basic_string<> part 2: template inline bool operator == (const sub_match& m, - const std::basic_string::value_type, traits, Allocator>& s) + const std::basic_string::value_type, traits, Allocator>& s) { return m.str().compare(s) == 0; } template inline bool operator != (const sub_match& m, - const std::basic_string::value_type, traits, Allocator>& s) + const std::basic_string::value_type, traits, Allocator>& s) { return m.str().compare(s) != 0; } template inline bool operator < (const sub_match& m, - const std::basic_string::value_type, traits, Allocator>& s) + const std::basic_string::value_type, traits, Allocator>& s) { return m.str().compare(s) < 0; } template inline bool operator > (const sub_match& m, - const std::basic_string::value_type, traits, Allocator>& s) + const std::basic_string::value_type, traits, Allocator>& s) { return m.str().compare(s) > 0; } template inline bool operator <= (const sub_match& m, - const std::basic_string::value_type, traits, Allocator>& s) + const std::basic_string::value_type, traits, Allocator>& s) { return m.str().compare(s) <= 0; } template inline bool operator >= (const sub_match& m, - const std::basic_string::value_type, traits, Allocator>& s) + const std::basic_string::value_type, traits, Allocator>& s) { return m.str().compare(s) >= 0; } // comparison to const charT* part 1: template inline bool operator == (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const* s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s) { return m.str().compare(s) == 0; } template inline bool operator != (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const* s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s) { return m.str().compare(s) != 0; } template inline bool operator > (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const* s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s) { return m.str().compare(s) > 0; } template inline bool operator < (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const* s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s) { return m.str().compare(s) < 0; } template inline bool operator >= (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const* s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s) { return m.str().compare(s) >= 0; } template inline bool operator <= (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const* s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s) { return m.str().compare(s) <= 0; } // comparison to const charT* part 2: template -inline bool operator == (typename re_detail::regex_iterator_traits::value_type const* s, +inline bool operator == (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s, const sub_match& m) { return m.str().compare(s) == 0; } template -inline bool operator != (typename re_detail::regex_iterator_traits::value_type const* s, +inline bool operator != (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s, const sub_match& m) { return m.str().compare(s) != 0; } template -inline bool operator < (typename re_detail::regex_iterator_traits::value_type const* s, +inline bool operator < (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s, const sub_match& m) { return m.str().compare(s) > 0; } template -inline bool operator > (typename re_detail::regex_iterator_traits::value_type const* s, +inline bool operator > (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s, const sub_match& m) { return m.str().compare(s) < 0; } template -inline bool operator <= (typename re_detail::regex_iterator_traits::value_type const* s, +inline bool operator <= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s, const sub_match& m) { return m.str().compare(s) >= 0; } template -inline bool operator >= (typename re_detail::regex_iterator_traits::value_type const* s, +inline bool operator >= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s, const sub_match& m) { return m.str().compare(s) <= 0; } // comparison to const charT& part 1: template inline bool operator == (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const& s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s) { return m.str().compare(0, m.length(), &s, 1) == 0; } template inline bool operator != (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const& s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s) { return m.str().compare(0, m.length(), &s, 1) != 0; } template inline bool operator > (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const& s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s) { return m.str().compare(0, m.length(), &s, 1) > 0; } template inline bool operator < (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const& s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s) { return m.str().compare(0, m.length(), &s, 1) < 0; } template inline bool operator >= (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const& s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s) { return m.str().compare(0, m.length(), &s, 1) >= 0; } template inline bool operator <= (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const& s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s) { return m.str().compare(0, m.length(), &s, 1) <= 0; } // comparison to const charT* part 2: template -inline bool operator == (typename re_detail::regex_iterator_traits::value_type const& s, +inline bool operator == (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s, const sub_match& m) { return m.str().compare(0, m.length(), &s, 1) == 0; } template -inline bool operator != (typename re_detail::regex_iterator_traits::value_type const& s, +inline bool operator != (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s, const sub_match& m) { return m.str().compare(0, m.length(), &s, 1) != 0; } template -inline bool operator < (typename re_detail::regex_iterator_traits::value_type const& s, +inline bool operator < (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s, const sub_match& m) { return m.str().compare(0, m.length(), &s, 1) > 0; } template -inline bool operator > (typename re_detail::regex_iterator_traits::value_type const& s, +inline bool operator > (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s, const sub_match& m) { return m.str().compare(0, m.length(), &s, 1) < 0; } template -inline bool operator <= (typename re_detail::regex_iterator_traits::value_type const& s, +inline bool operator <= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s, const sub_match& m) { return m.str().compare(0, m.length(), &s, 1) >= 0; } template -inline bool operator >= (typename re_detail::regex_iterator_traits::value_type const& s, +inline bool operator >= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s, const sub_match& m) { return m.str().compare(0, m.length(), &s, 1) <= 0; } // addition operators: template -inline std::basic_string::value_type, traits, Allocator> -operator + (const std::basic_string::value_type, traits, Allocator>& s, +inline std::basic_string::value_type, traits, Allocator> +operator + (const std::basic_string::value_type, traits, Allocator>& s, const sub_match& m) { - std::basic_string::value_type, traits, Allocator> result; + std::basic_string::value_type, traits, Allocator> result; result.reserve(s.size() + m.length() + 1); return result.append(s).append(m.first, m.second); } template -inline std::basic_string::value_type, traits, Allocator> +inline std::basic_string::value_type, traits, Allocator> operator + (const sub_match& m, - const std::basic_string::value_type, traits, Allocator>& s) + const std::basic_string::value_type, traits, Allocator>& s) { - std::basic_string::value_type, traits, Allocator> result; + std::basic_string::value_type, traits, Allocator> result; result.reserve(s.size() + m.length() + 1); return result.append(m.first, m.second).append(s); } #if !(defined(__GNUC__) && defined(BOOST_NO_STD_LOCALE)) template -inline std::basic_string::value_type> -operator + (typename re_detail::regex_iterator_traits::value_type const* s, +inline std::basic_string::value_type> +operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s, const sub_match& m) { - std::basic_string::value_type> result; - result.reserve(std::char_traits::value_type>::length(s) + m.length() + 1); + std::basic_string::value_type> result; + result.reserve(std::char_traits::value_type>::length(s) + m.length() + 1); return result.append(s).append(m.first, m.second); } template -inline std::basic_string::value_type> +inline std::basic_string::value_type> operator + (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const * s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const * s) { - std::basic_string::value_type> result; - result.reserve(std::char_traits::value_type>::length(s) + m.length() + 1); + std::basic_string::value_type> result; + result.reserve(std::char_traits::value_type>::length(s) + m.length() + 1); return result.append(m.first, m.second).append(s); } #else // worwaround versions: template -inline std::basic_string::value_type> -operator + (typename re_detail::regex_iterator_traits::value_type const* s, +inline std::basic_string::value_type> +operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const* s, const sub_match& m) { return s + m.str(); } template -inline std::basic_string::value_type> +inline std::basic_string::value_type> operator + (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const * s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const * s) { return m.str() + s; } #endif template -inline std::basic_string::value_type> -operator + (typename re_detail::regex_iterator_traits::value_type const& s, +inline std::basic_string::value_type> +operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s, const sub_match& m) { - std::basic_string::value_type> result; + std::basic_string::value_type> result; result.reserve(m.length() + 2); return result.append(1, s).append(m.first, m.second); } template -inline std::basic_string::value_type> +inline std::basic_string::value_type> operator + (const sub_match& m, - typename re_detail::regex_iterator_traits::value_type const& s) + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::value_type const& s) { - std::basic_string::value_type> result; + std::basic_string::value_type> result; result.reserve(m.length() + 2); return result.append(m.first, m.second).append(1, s); } template -inline std::basic_string::value_type> +inline std::basic_string::value_type> operator + (const sub_match& m1, const sub_match& m2) { - std::basic_string::value_type> result; + std::basic_string::value_type> result; result.reserve(m1.length() + m2.length() + 1); return result.append(m1.first, m1.second).append(m2.first, m2.second); } @@ -445,7 +445,7 @@ std::ostream& operator << (std::ostream& os, #endif #ifdef BOOST_OLD_REGEX_H -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ template int do_toi(BidiIterator i, BidiIterator j, char c, int radix) { @@ -484,7 +484,7 @@ sub_match::operator int()const neg = -1; ++i; } - neg *= re_detail::do_toi(i, j, *i); + neg *= BOOST_REGEX_DETAIL_NS::do_toi(i, j, *i); if(i != j)raise_regex_exception("Bad sub-expression"); return neg; } @@ -495,7 +495,7 @@ sub_match::operator unsigned int()const BidiIterator j = second; if(i == j) raise_regex_exception("Bad sub-expression"); - return re_detail::do_toi(i, j, *first); + return BOOST_REGEX_DETAIL_NS::do_toi(i, j, *first); } #endif diff --git a/include/boost/regex/v4/u32regex_iterator.hpp b/include/boost/regex/v4/u32regex_iterator.hpp index 65ebd7f8..701ef3d8 100644 --- a/include/boost/regex/v4/u32regex_iterator.hpp +++ b/include/boost/regex/v4/u32regex_iterator.hpp @@ -76,7 +76,7 @@ class u32regex_iterator : public std::iterator< std::forward_iterator_tag, match_results, - typename re_detail::regex_iterator_traits::difference_type, + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::difference_type, const match_results*, const match_results& > #endif @@ -87,7 +87,7 @@ private: public: typedef u32regex regex_type; typedef match_results value_type; - typedef typename re_detail::regex_iterator_traits::difference_type + typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::difference_type difference_type; typedef const value_type* pointer; typedef const value_type& reference; diff --git a/include/boost/regex/v4/u32regex_token_iterator.hpp b/include/boost/regex/v4/u32regex_token_iterator.hpp index e8649f32..9eabbe48 100644 --- a/include/boost/regex/v4/u32regex_token_iterator.hpp +++ b/include/boost/regex/v4/u32regex_token_iterator.hpp @@ -159,7 +159,7 @@ class u32regex_token_iterator : public std::iterator< std::forward_iterator_tag, sub_match, - typename re_detail::regex_iterator_traits::difference_type, + typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::difference_type, const sub_match*, const sub_match& > #endif @@ -170,7 +170,7 @@ private: public: typedef u32regex regex_type; typedef sub_match value_type; - typedef typename re_detail::regex_iterator_traits::difference_type + typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits::difference_type difference_type; typedef const value_type* pointer; typedef const value_type& reference; diff --git a/include/boost/regex/v4/w32_regex_traits.hpp b/include/boost/regex/v4/w32_regex_traits.hpp index ef934b75..4a799526 100644 --- a/include/boost/regex/v4/w32_regex_traits.hpp +++ b/include/boost/regex/v4/w32_regex_traits.hpp @@ -60,7 +60,7 @@ namespace boost{ template class w32_regex_traits; -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ // // start by typedeffing the types we'll need: @@ -164,19 +164,19 @@ public: map_iterator_type i = m_char_map.find(c); if(i == m_char_map.end()) { - if(::boost::re_detail::w32_is_lower(c, this->m_locale)) return regex_constants::escape_type_class; - if(::boost::re_detail::w32_is_upper(c, this->m_locale)) return regex_constants::escape_type_not_class; + if(::boost::BOOST_REGEX_DETAIL_NS::w32_is_lower(c, this->m_locale)) return regex_constants::escape_type_class; + if(::boost::BOOST_REGEX_DETAIL_NS::w32_is_upper(c, this->m_locale)) return regex_constants::escape_type_not_class; return 0; } return i->second; } charT tolower(charT c)const { - return ::boost::re_detail::w32_tolower(c, this->m_locale); + return ::boost::BOOST_REGEX_DETAIL_NS::w32_tolower(c, this->m_locale); } bool isctype(boost::uint32_t mask, charT c)const { - return ::boost::re_detail::w32_is(this->m_locale, mask, c); + return ::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, mask, c); } private: @@ -186,7 +186,7 @@ private: }; template -w32_regex_traits_char_layer::w32_regex_traits_char_layer(::boost::re_detail::lcid_type l) +w32_regex_traits_char_layer::w32_regex_traits_char_layer(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l) : w32_regex_traits_base(l) { // we need to start by initialising our syntax map so we know which @@ -195,12 +195,12 @@ w32_regex_traits_char_layer::w32_regex_traits_char_layer(::boost::re_deta std::string cat_name(w32_regex_traits::get_catalog_name()); if(cat_name.size()) { - cat = ::boost::re_detail::w32_cat_open(cat_name); + cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name); if(!cat) { std::string m("Unable to open message catalog: "); std::runtime_error err(m + cat_name); - boost::re_detail::raise_runtime_error(err); + boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); } } // @@ -210,7 +210,7 @@ w32_regex_traits_char_layer::w32_regex_traits_char_layer(::boost::re_deta { for(regex_constants::syntax_type i = 1; i < regex_constants::syntax_max; ++i) { - string_type mss = ::boost::re_detail::w32_cat_get(cat, this->m_locale, i, get_default_message(i)); + string_type mss = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i, get_default_message(i)); for(typename string_type::size_type j = 0; j < mss.size(); ++j) { this->m_char_map[mss[j]] = i; @@ -253,7 +253,7 @@ class BOOST_REGEX_DECL w32_regex_traits_char_layer : public w32_regex_trai { typedef std::string string_type; public: - w32_regex_traits_char_layer(::boost::re_detail::lcid_type l) + w32_regex_traits_char_layer(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l) : w32_regex_traits_base(l) { init(); @@ -300,7 +300,7 @@ public: typedef std::basic_string string_type; typedef charT char_type; - w32_regex_traits_implementation(::boost::re_detail::lcid_type l); + w32_regex_traits_implementation(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l); std::string error_string(regex_constants::error_type n) const { if(!m_error_strings.empty()) @@ -327,7 +327,7 @@ public: string_type transform_primary(const charT* p1, const charT* p2) const; string_type transform(const charT* p1, const charT* p2) const { - return ::boost::re_detail::w32_transform(this->m_locale, p1, p2); + return ::boost::BOOST_REGEX_DETAIL_NS::w32_transform(this->m_locale, p1, p2); } private: std::map m_error_strings; // error messages indexed by numberic ID @@ -430,19 +430,19 @@ typename w32_regex_traits_implementation::string_type } template -w32_regex_traits_implementation::w32_regex_traits_implementation(::boost::re_detail::lcid_type l) +w32_regex_traits_implementation::w32_regex_traits_implementation(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l) : w32_regex_traits_char_layer(l) { cat_type cat; std::string cat_name(w32_regex_traits::get_catalog_name()); if(cat_name.size()) { - cat = ::boost::re_detail::w32_cat_open(cat_name); + cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name); if(!cat) { std::string m("Unable to open message catalog: "); std::runtime_error err(m + cat_name); - boost::re_detail::raise_runtime_error(err); + boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); } } // @@ -464,7 +464,7 @@ w32_regex_traits_implementation::w32_regex_traits_implementation(::boost: default_message.append(1, static_cast(*p)); ++p; } - string_type s = ::boost::re_detail::w32_cat_get(cat, this->m_locale, i+200, default_message); + string_type s = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i+200, default_message); std::string result; for(std::string::size_type j = 0; j < s.size(); ++j) { @@ -495,7 +495,7 @@ w32_regex_traits_implementation::w32_regex_traits_implementation(::boost: static const string_type null_string; for(unsigned int j = 0; j <= 13; ++j) { - string_type s(::boost::re_detail::w32_cat_get(cat, this->m_locale, j+300, null_string)); + string_type s(::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, j+300, null_string)); if(s.size()) this->m_custom_class_names[s] = masks[j]; } @@ -503,7 +503,7 @@ w32_regex_traits_implementation::w32_regex_traits_implementation(::boost: // // get the collation format used by m_pcollate: // - m_collate_type = re_detail::find_sort_syntax(this, &m_collate_delim); + m_collate_type = BOOST_REGEX_DETAIL_NS::find_sort_syntax(this, &m_collate_delim); } template @@ -542,7 +542,7 @@ typename w32_regex_traits_implementation::char_class_type if(pos != m_custom_class_names.end()) return pos->second; } - std::size_t state_id = 1 + re_detail::get_default_class_id(p1, p2); + std::size_t state_id = 1 + BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2); if(state_id < sizeof(masks) / sizeof(masks[0])) return masks[state_id]; return masks[0]; @@ -550,13 +550,13 @@ typename w32_regex_traits_implementation::char_class_type template -boost::shared_ptr > create_w32_regex_traits(::boost::re_detail::lcid_type l) +boost::shared_ptr > create_w32_regex_traits(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l) { // TODO: create a cache for previously constructed objects. - return boost::object_cache< ::boost::re_detail::lcid_type, w32_regex_traits_implementation >::get(l, 5); + return boost::object_cache< ::boost::BOOST_REGEX_DETAIL_NS::lcid_type, w32_regex_traits_implementation >::get(l, 5); } -} // re_detail +} // BOOST_REGEX_DETAIL_NS template class w32_regex_traits @@ -565,13 +565,13 @@ public: typedef charT char_type; typedef std::size_t size_type; typedef std::basic_string string_type; - typedef ::boost::re_detail::lcid_type locale_type; + typedef ::boost::BOOST_REGEX_DETAIL_NS::lcid_type locale_type; typedef boost::uint_least32_t char_class_type; struct boost_extensions_tag{}; w32_regex_traits() - : m_pimpl(re_detail::create_w32_regex_traits(::boost::re_detail::w32_get_default_locale())) + : m_pimpl(BOOST_REGEX_DETAIL_NS::create_w32_regex_traits(::boost::BOOST_REGEX_DETAIL_NS::w32_get_default_locale())) { } static size_type length(const char_type* p) { @@ -603,11 +603,11 @@ public: } charT toupper(charT c) const { - return ::boost::re_detail::w32_toupper(c, this->m_pimpl->m_locale); + return ::boost::BOOST_REGEX_DETAIL_NS::w32_toupper(c, this->m_pimpl->m_locale); } string_type transform(const charT* p1, const charT* p2) const { - return ::boost::re_detail::w32_transform(this->m_pimpl->m_locale, p1, p2); + return ::boost::BOOST_REGEX_DETAIL_NS::w32_transform(this->m_pimpl->m_locale, p1, p2); } string_type transform_primary(const charT* p1, const charT* p2) const { @@ -623,34 +623,34 @@ public: } bool isctype(charT c, char_class_type f) const { - if((f & re_detail::w32_regex_traits_implementation::mask_base) - && (this->m_pimpl->isctype(f & re_detail::w32_regex_traits_implementation::mask_base, c))) + if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation::mask_base) + && (this->m_pimpl->isctype(f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation::mask_base, c))) return true; - else if((f & re_detail::w32_regex_traits_implementation::mask_unicode) && re_detail::is_extended(c)) + else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation::mask_unicode) && BOOST_REGEX_DETAIL_NS::is_extended(c)) return true; - else if((f & re_detail::w32_regex_traits_implementation::mask_word) && (c == '_')) + else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation::mask_word) && (c == '_')) return true; - else if((f & re_detail::w32_regex_traits_implementation::mask_vertical) - && (::boost::re_detail::is_separator(c) || (c == '\v'))) + else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation::mask_vertical) + && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == '\v'))) return true; - else if((f & re_detail::w32_regex_traits_implementation::mask_horizontal) - && this->isctype(c, 0x0008u) && !this->isctype(c, re_detail::w32_regex_traits_implementation::mask_vertical)) + else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation::mask_horizontal) + && this->isctype(c, 0x0008u) && !this->isctype(c, BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation::mask_vertical)) return true; return false; } int toi(const charT*& p1, const charT* p2, int radix)const { - return ::boost::re_detail::global_toi(p1, p2, radix, *this); + return ::boost::BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this); } int value(charT c, int radix)const { - int result = ::boost::re_detail::global_value(c); + int result = ::boost::BOOST_REGEX_DETAIL_NS::global_value(c); return result < radix ? result : -1; } locale_type imbue(locale_type l) { - ::boost::re_detail::lcid_type result(getloc()); - m_pimpl = re_detail::create_w32_regex_traits(l); + ::boost::BOOST_REGEX_DETAIL_NS::lcid_type result(getloc()); + m_pimpl = BOOST_REGEX_DETAIL_NS::create_w32_regex_traits(l); return result; } locale_type getloc()const @@ -670,7 +670,7 @@ public: static std::string get_catalog_name(); private: - boost::shared_ptr > m_pimpl; + boost::shared_ptr > m_pimpl; // // catalog name handler: // diff --git a/src/c_regex_traits.cpp b/src/c_regex_traits.cpp index 23ec3247..a0b52ee4 100644 --- a/src/c_regex_traits.cpp +++ b/src/c_regex_traits.cpp @@ -77,7 +77,7 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::transfo c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::transform_primary(const char* p1, const char* p2) { static char s_delim; - static const int s_collate_type = ::boost::re_detail::find_sort_syntax(static_cast*>(0), &s_delim); + static const int s_collate_type = ::boost::BOOST_REGEX_DETAIL_NS::find_sort_syntax(static_cast*>(0), &s_delim); std::string result; // // What we do here depends upon the format of the sort key returned by @@ -85,8 +85,8 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::transfo // switch(s_collate_type) { - case ::boost::re_detail::sort_C: - case ::boost::re_detail::sort_unknown: + case ::boost::BOOST_REGEX_DETAIL_NS::sort_C: + case ::boost::BOOST_REGEX_DETAIL_NS::sort_unknown: // the best we can do is translate to lower case, then get a regular sort key: { result.assign(p1, p2); @@ -95,14 +95,14 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::transfo result = transform(&*result.begin(), &*result.begin() + result.size()); break; } - case ::boost::re_detail::sort_fixed: + case ::boost::BOOST_REGEX_DETAIL_NS::sort_fixed: { // get a regular sort key, and then truncate it: result = transform(p1, p2); result.erase(s_delim); break; } - case ::boost::re_detail::sort_delim: + case ::boost::BOOST_REGEX_DETAIL_NS::sort_delim: // get a regular sort key, and then truncate everything after the delim: result = transform(p1, p2); if(result.size() && (result[0] == s_delim)) @@ -149,13 +149,13 @@ c_regex_traits::char_class_type BOOST_REGEX_CALL c_regex_traits::loo char_class_xdigit, }; - int idx = ::boost::re_detail::get_default_class_id(p1, p2); + int idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2); if(idx < 0) { std::string s(p1, p2); for(std::string::size_type i = 0; i < s.size(); ++i) s[i] = static_cast((std::tolower)(static_cast(s[i]))); - idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size()); + idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size()); } BOOST_ASSERT(std::size_t(idx+1) < sizeof(masks) / sizeof(masks[0])); return masks[idx+1]; @@ -173,16 +173,16 @@ bool BOOST_REGEX_CALL c_regex_traits::isctype(char c, char_class_type mask || ((mask & char_class_digit) && (std::isdigit)(static_cast(c))) || ((mask & char_class_punct) && (std::ispunct)(static_cast(c))) || ((mask & char_class_xdigit) && (std::isxdigit)(static_cast(c))) - || ((mask & char_class_blank) && (std::isspace)(static_cast(c)) && !::boost::re_detail::is_separator(c)) + || ((mask & char_class_blank) && (std::isspace)(static_cast(c)) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c)) || ((mask & char_class_word) && (c == '_')) - || ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == '\v'))) - || ((mask & char_class_horizontal) && (std::isspace)(static_cast(c)) && !::boost::re_detail::is_separator(c) && (c != '\v')); + || ((mask & char_class_vertical) && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == '\v'))) + || ((mask & char_class_horizontal) && (std::isspace)(static_cast(c)) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) && (c != '\v')); } c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::lookup_collatename(const char* p1, const char* p2) { std::string s(p1, p2); - s = ::boost::re_detail::lookup_default_collate_name(s); + s = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(s); if(s.empty() && (p2-p1 == 1)) s.append(1, *p1); return s; diff --git a/src/cpp_regex_traits.cpp b/src/cpp_regex_traits.cpp index 1d24cc1a..05bbc50d 100644 --- a/src/cpp_regex_traits.cpp +++ b/src/cpp_regex_traits.cpp @@ -28,7 +28,7 @@ namespace std{ } #endif -namespace boost{ namespace re_detail{ +namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ void cpp_regex_traits_char_layer::init() { @@ -51,7 +51,7 @@ void cpp_regex_traits_char_layer::init() { std::string m("Unable to open message catalog: "); std::runtime_error err(m + cat_name); - boost::re_detail::raise_runtime_error(err); + boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); } } // @@ -111,7 +111,7 @@ void cpp_regex_traits_char_layer::init() }while(0xFF != i++); } -} // re_detail +} // BOOST_REGEX_DETAIL_NS } // boost #endif diff --git a/src/cregex.cpp b/src/cregex.cpp index 8d69139f..01efc3f3 100644 --- a/src/cregex.cpp +++ b/src/cregex.cpp @@ -68,7 +68,7 @@ inline std::string to_string(const char* i, const char* j) } } -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ class RegExData { @@ -141,12 +141,12 @@ void RegExData::clean() RegEx::RegEx() { - pdata = new re_detail::RegExData(); + pdata = new BOOST_REGEX_DETAIL_NS::RegExData(); } RegEx::RegEx(const RegEx& o) { - pdata = new re_detail::RegExData(*(o.pdata)); + pdata = new BOOST_REGEX_DETAIL_NS::RegExData(*(o.pdata)); } RegEx::~RegEx() @@ -156,13 +156,13 @@ RegEx::~RegEx() RegEx::RegEx(const char* c, bool icase) { - pdata = new re_detail::RegExData(); + pdata = new BOOST_REGEX_DETAIL_NS::RegExData(); SetExpression(c, icase); } RegEx::RegEx(const std::string& s, bool icase) { - pdata = new re_detail::RegExData(); + pdata = new BOOST_REGEX_DETAIL_NS::RegExData(); SetExpression(s.c_str(), icase); } @@ -200,7 +200,7 @@ std::string RegEx::Expression()const // bool RegEx::Match(const char* p, match_flag_type flags) { - pdata->t = re_detail::RegExData::type_pc; + pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc; pdata->pbase = p; const char* end = p; while(*end)++end; @@ -215,7 +215,7 @@ bool RegEx::Match(const char* p, match_flag_type flags) bool RegEx::Search(const char* p, match_flag_type flags) { - pdata->t = re_detail::RegExData::type_pc; + pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc; pdata->pbase = p; const char* end = p; while(*end)++end; @@ -227,7 +227,7 @@ bool RegEx::Search(const char* p, match_flag_type flags) } return false; } -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ struct pred1 { GrepCallback cb; @@ -242,17 +242,17 @@ struct pred1 } unsigned int RegEx::Grep(GrepCallback cb, const char* p, match_flag_type flags) { - pdata->t = re_detail::RegExData::type_pc; + pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc; pdata->pbase = p; const char* end = p; while(*end)++end; - unsigned int result = regex_grep(re_detail::pred1(cb, this), p, end, pdata->e, flags); + unsigned int result = regex_grep(BOOST_REGEX_DETAIL_NS::pred1(cb, this), p, end, pdata->e, flags); if(result) pdata->update(); return result; } -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ struct pred2 { std::vector& v; @@ -271,17 +271,17 @@ private: unsigned int RegEx::Grep(std::vector& v, const char* p, match_flag_type flags) { - pdata->t = re_detail::RegExData::type_pc; + pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc; pdata->pbase = p; const char* end = p; while(*end)++end; - unsigned int result = regex_grep(re_detail::pred2(v, this), p, end, pdata->e, flags); + unsigned int result = regex_grep(BOOST_REGEX_DETAIL_NS::pred2(v, this), p, end, pdata->e, flags); if(result) pdata->update(); return result; } -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ struct pred3 { std::vector& v; @@ -300,18 +300,18 @@ private: } unsigned int RegEx::Grep(std::vector& v, const char* p, match_flag_type flags) { - pdata->t = re_detail::RegExData::type_pc; + pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc; pdata->pbase = p; const char* end = p; while(*end)++end; - unsigned int result = regex_grep(re_detail::pred3(v, p, this), p, end, pdata->e, flags); + unsigned int result = regex_grep(BOOST_REGEX_DETAIL_NS::pred3(v, p, this), p, end, pdata->e, flags); if(result) pdata->update(); return result; } #ifndef BOOST_REGEX_NO_FILEITER -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ struct pred4 { GrepFileCallback cb; @@ -338,17 +338,17 @@ void BuildFileList(std::list* pl, const char* files, bool recurse) { // go through sub directories: char buf[MAX_PATH]; - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(buf, MAX_PATH, start.root())); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(buf, MAX_PATH, start.root())); if(*buf == 0) { - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(buf, MAX_PATH, ".")); - re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, directory_iterator::separator())); - re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, "*")); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(buf, MAX_PATH, ".")); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, directory_iterator::separator())); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, "*")); } else { - re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, directory_iterator::separator())); - re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, "*")); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, directory_iterator::separator())); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, "*")); } directory_iterator dstart(buf); directory_iterator dend; @@ -403,9 +403,9 @@ unsigned int RegEx::GrepFiles(GrepFileCallback cb, const char* files, bool recur while(start != end) { mapfile map((*start).c_str()); - pdata->t = re_detail::RegExData::type_pf; + pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pf; pdata->fbase = map.begin(); - re_detail::pred4 pred(cb, this, (*start).c_str()); + BOOST_REGEX_DETAIL_NS::pred4 pred(cb, this, (*start).c_str()); int r = regex_grep(pred, map.begin(), map.end(), pdata->e, flags); result += r; ++start; @@ -430,7 +430,7 @@ unsigned int RegEx::FindFiles(FindFilesCallback cb, const char* files, bool recu while(start != end) { mapfile map((*start).c_str()); - pdata->t = re_detail::RegExData::type_pf; + pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pf; pdata->fbase = map.begin(); if(regex_search(map.begin(), map.end(), pdata->fm, pdata->e, flags)) @@ -456,7 +456,7 @@ std::string RegEx::Merge(const std::string& in, const std::string& fmt, bool copy, match_flag_type flags) { std::string result; - re_detail::string_out_iterator i(result); + BOOST_REGEX_DETAIL_NS::string_out_iterator i(result); if(!copy) flags |= format_no_copy; regex_replace(i, in.begin(), in.end(), pdata->e, fmt.c_str(), flags); return result; @@ -467,7 +467,7 @@ std::string RegEx::Merge(const char* in, const char* fmt, { std::string result; if(!copy) flags |= format_no_copy; - re_detail::string_out_iterator i(result); + BOOST_REGEX_DETAIL_NS::string_out_iterator i(result); regex_replace(i, in, in + std::strlen(in), pdata->e, fmt, flags); return result; } @@ -489,13 +489,13 @@ std::size_t RegEx::Position(int i)const { switch(pdata->t) { - case re_detail::RegExData::type_pc: + case BOOST_REGEX_DETAIL_NS::RegExData::type_pc: return pdata->m[i].matched ? pdata->m[i].first - pdata->pbase : RegEx::npos; #ifndef BOOST_REGEX_NO_FILEITER - case re_detail::RegExData::type_pf: + case BOOST_REGEX_DETAIL_NS::RegExData::type_pf: return pdata->fm[i].matched ? pdata->fm[i].first - pdata->fbase : RegEx::npos; #endif - case re_detail::RegExData::type_copy: + case BOOST_REGEX_DETAIL_NS::RegExData::type_copy: { std::map >::iterator pos = pdata->positions.find(i); if(pos == pdata->positions.end()) @@ -516,13 +516,13 @@ std::size_t RegEx::Length(int i)const { switch(pdata->t) { - case re_detail::RegExData::type_pc: + case BOOST_REGEX_DETAIL_NS::RegExData::type_pc: return pdata->m[i].matched ? pdata->m[i].second - pdata->m[i].first : RegEx::npos; #ifndef BOOST_REGEX_NO_FILEITER - case re_detail::RegExData::type_pf: + case BOOST_REGEX_DETAIL_NS::RegExData::type_pf: return pdata->fm[i].matched ? pdata->fm[i].second - pdata->fm[i].first : RegEx::npos; #endif - case re_detail::RegExData::type_copy: + case BOOST_REGEX_DETAIL_NS::RegExData::type_copy: { std::map >::iterator pos = pdata->strings.find(i); if(pos == pdata->strings.end()) @@ -537,13 +537,13 @@ bool RegEx::Matched(int i)const { switch(pdata->t) { - case re_detail::RegExData::type_pc: + case BOOST_REGEX_DETAIL_NS::RegExData::type_pc: return pdata->m[i].matched; #ifndef BOOST_REGEX_NO_FILEITER - case re_detail::RegExData::type_pf: + case BOOST_REGEX_DETAIL_NS::RegExData::type_pf: return pdata->fm[i].matched; #endif - case re_detail::RegExData::type_copy: + case BOOST_REGEX_DETAIL_NS::RegExData::type_copy: { std::map >::iterator pos = pdata->strings.find(i); if(pos == pdata->strings.end()) @@ -560,15 +560,15 @@ std::string RegEx::What(int i)const std::string result; switch(pdata->t) { - case re_detail::RegExData::type_pc: + case BOOST_REGEX_DETAIL_NS::RegExData::type_pc: if(pdata->m[i].matched) result.assign(pdata->m[i].first, pdata->m[i].second); break; - case re_detail::RegExData::type_pf: + case BOOST_REGEX_DETAIL_NS::RegExData::type_pf: if(pdata->m[i].matched) result.assign(to_string(pdata->m[i].first, pdata->m[i].second)); break; - case re_detail::RegExData::type_copy: + case BOOST_REGEX_DETAIL_NS::RegExData::type_copy: { std::map >::iterator pos = pdata->strings.find(i); if(pos != pdata->strings.end()) diff --git a/src/fileiter.cpp b/src/fileiter.cpp index 5f65127f..c48ed657 100644 --- a/src/fileiter.cpp +++ b/src/fileiter.cpp @@ -58,7 +58,7 @@ namespace std{ #endif namespace boost{ - namespace re_detail{ + namespace BOOST_REGEX_DETAIL_NS{ // start with the operating system specific stuff: #if (defined(__BORLANDC__) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32) @@ -110,7 +110,7 @@ void mapfile::open(const char* file) hmap = 0; hfile = 0; std::runtime_error err("Unable to create file mapping."); - boost::re_detail::raise_runtime_error(err); + boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); } _first = static_cast(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0)); if(_first == 0) @@ -397,9 +397,9 @@ inline void copy_find_file_result_with_overflow_check(const _fi_find_data& data, { #ifdef BOOST_NO_ANSI_APIS if (::WideCharToMultiByte(CP_ACP, 0, data.cFileName, -1, path, max_size, NULL, NULL) == 0) - re_detail::overflow_error_if_not_zero(1); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(1); #else - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(path, max_size, data.cFileName)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(path, max_size, data.cFileName)); #endif } @@ -454,22 +454,22 @@ file_iterator::file_iterator(const char* wild) BOOST_REGEX_NOEH_ASSERT(_root) _path = new char[MAX_PATH]; BOOST_REGEX_NOEH_ASSERT(_path) - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, wild)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, wild)); ptr = _root; while(*ptr)++ptr; while((ptr > _root) && (*ptr != *_fi_sep) && (*ptr != *_fi_sep_alt))--ptr; if((ptr == _root) && ( (*ptr== *_fi_sep) || (*ptr==*_fi_sep_alt) ) ) { _root[1]='\0'; - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root)); } else { *ptr = 0; - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root)); if(*_path == 0) - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, ".")); - re_detail::overflow_error_if_not_zero(re_detail::strcat_s(_path, MAX_PATH, _fi_sep)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, ".")); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(_path, MAX_PATH, _fi_sep)); } ptr = _path + std::strlen(_path); @@ -512,8 +512,8 @@ file_iterator::file_iterator(const file_iterator& other) BOOST_REGEX_NOEH_ASSERT(_root) _path = new char[MAX_PATH]; BOOST_REGEX_NOEH_ASSERT(_path) - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root)); - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path)); ptr = _path + (other.ptr - other._path); ref = other.ref; #ifndef BOOST_NO_EXCEPTIONS @@ -530,8 +530,8 @@ file_iterator::file_iterator(const file_iterator& other) file_iterator& file_iterator::operator=(const file_iterator& other) { - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root)); - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path)); ptr = _path + (other.ptr - other._path); if(--(ref->count) == 0) { @@ -632,7 +632,7 @@ directory_iterator::directory_iterator(const char* wild) BOOST_REGEX_NOEH_ASSERT(_root) _path = new char[MAX_PATH]; BOOST_REGEX_NOEH_ASSERT(_path) - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, wild)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, wild)); ptr = _root; while(*ptr)++ptr; while((ptr > _root) && (*ptr != *_fi_sep) && (*ptr != *_fi_sep_alt))--ptr; @@ -640,15 +640,15 @@ directory_iterator::directory_iterator(const char* wild) if((ptr == _root) && ( (*ptr== *_fi_sep) || (*ptr==*_fi_sep_alt) ) ) { _root[1]='\0'; - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root)); } else { *ptr = 0; - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root)); if(*_path == 0) - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, ".")); - re_detail::overflow_error_if_not_zero(re_detail::strcat_s(_path, MAX_PATH, _fi_sep)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, ".")); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(_path, MAX_PATH, _fi_sep)); } ptr = _path + std::strlen(_path); @@ -702,8 +702,8 @@ directory_iterator::directory_iterator(const directory_iterator& other) BOOST_REGEX_NOEH_ASSERT(_root) _path = new char[MAX_PATH]; BOOST_REGEX_NOEH_ASSERT(_path) - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root)); - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path)); ptr = _path + (other.ptr - other._path); ref = other.ref; #ifndef BOOST_NO_EXCEPTIONS @@ -720,8 +720,8 @@ directory_iterator::directory_iterator(const directory_iterator& other) directory_iterator& directory_iterator::operator=(const directory_iterator& other) { - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root)); - re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root)); + BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path)); ptr = _path + (other.ptr - other._path); if(--(ref->count) == 0) { @@ -910,7 +910,7 @@ bool _fi_FindClose(_fi_find_handle dat) #endif -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS } // namspace boost #endif // BOOST_REGEX_NO_FILEITER diff --git a/src/icu.cpp b/src/icu.cpp index 2fa2b3b1..5d166a69 100644 --- a/src/icu.cpp +++ b/src/icu.cpp @@ -28,7 +28,7 @@ namespace boost{ -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ icu_regex_traits_implementation::string_type icu_regex_traits_implementation::do_transform(const char_type* p1, const char_type* p2, const U_NAMESPACE_QUALIFIER Collator* pcoll) const { @@ -191,7 +191,7 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_icu_mask(const ::UCha /* zs */ 'z', 's', }; - static const re_detail::character_pointer_range< ::UChar32> range_data[] = { + static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32> range_data[] = { { prop_name_table+0, prop_name_table+3, }, // any { prop_name_table+3, prop_name_table+8, }, // ascii { prop_name_table+8, prop_name_table+16, }, // assigned @@ -354,11 +354,11 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_icu_mask(const ::UCha }; - static const re_detail::character_pointer_range< ::UChar32>* ranges_begin = range_data; - static const re_detail::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0])); + static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data; + static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0])); - re_detail::character_pointer_range< ::UChar32> t = { p1, p2, }; - const re_detail::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t); + BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32> t = { p1, p2, }; + const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t); if((p != ranges_end) && (t == *p)) return icu_class_map[p - ranges_begin]; return 0; @@ -392,7 +392,7 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_classname(const char_ char_class_type(U_GC_ND_MASK) | mask_xdigit, }; - int idx = ::boost::re_detail::get_default_class_id(p1, p2); + int idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2); if(idx >= 0) return masks[idx+1]; char_class_type result = lookup_icu_mask(p1, p2); @@ -415,7 +415,7 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_classname(const char_ } } if(s.size()) - idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size()); + idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size()); if(idx >= 0) return masks[idx+1]; if(s.size()) @@ -457,7 +457,7 @@ icu_regex_traits::string_type icu_regex_traits::lookup_collatename(const char_ty return result; } // try POSIX name: - s = ::boost::re_detail::lookup_default_collate_name(s); + s = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(s); #ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS result.assign(s.begin(), s.end()); #else @@ -495,9 +495,9 @@ bool icu_regex_traits::isctype(char_type c, char_class_type f) const return true; if(((f & mask_ascii) != 0) && (c <= 0x7F)) return true; - if(((f & mask_vertical) != 0) && (::boost::re_detail::is_separator(c) || (c == static_cast('\v')) || (m == U_GC_ZL_MASK) || (m == U_GC_ZP_MASK))) + if(((f & mask_vertical) != 0) && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == static_cast('\v')) || (m == U_GC_ZL_MASK) || (m == U_GC_ZP_MASK))) return true; - if(((f & mask_horizontal) != 0) && !::boost::re_detail::is_separator(c) && u_isspace(c) && (c != static_cast('\v'))) + if(((f & mask_horizontal) != 0) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) && u_isspace(c) && (c != static_cast('\v'))) return true; return false; } diff --git a/src/posix_api.cpp b/src/posix_api.cpp index 8a803b3c..eb351561 100644 --- a/src/posix_api.cpp +++ b/src/posix_api.cpp @@ -154,7 +154,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* { result = std::strlen(names[code]) + 1; if(buf_size >= result) - re_detail::strcpy_s(buf, buf_size, names[code]); + BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, names[code]); return result; } return result; @@ -180,7 +180,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* if(r < 0) return 0; // sprintf failed if(std::strlen(localbuf) < buf_size) - re_detail::strcpy_s(buf, buf_size, localbuf); + BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, localbuf); return std::strlen(localbuf) + 1; } } @@ -190,7 +190,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* (std::sprintf)(localbuf, "%d", 0); #endif if(std::strlen(localbuf) < buf_size) - re_detail::strcpy_s(buf, buf_size, localbuf); + BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, localbuf); return std::strlen(localbuf) + 1; } if(code <= (int)REG_E_UNKNOWN) @@ -200,12 +200,12 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* p = static_cast(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code)); else { - p = re_detail::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code)); + p = BOOST_REGEX_DETAIL_NS::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code)); } std::size_t len = p.size(); if(len < buf_size) { - re_detail::strcpy_s(buf, buf_size, p.c_str()); + BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, p.c_str()); } return len + 1; } diff --git a/src/regex.cpp b/src/regex.cpp index ea20a06b..03057aac 100644 --- a/src/regex.cpp +++ b/src/regex.cpp @@ -64,7 +64,7 @@ regex_error::regex_error(const std::string& s, regex_constants::error_type err, } regex_error::regex_error(regex_constants::error_type err) - : std::runtime_error(::boost::re_detail::get_default_error_string(err)) + : std::runtime_error(::boost::BOOST_REGEX_DETAIL_NS::get_default_error_string(err)) , m_error_code(err) , m_position(0) { @@ -83,7 +83,7 @@ void regex_error::raise()const -namespace re_detail{ +namespace BOOST_REGEX_DETAIL_NS{ BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex) { @@ -211,7 +211,7 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void* p) #endif -} // namespace re_detail +} // namespace BOOST_REGEX_DETAIL_NS diff --git a/src/regex_raw_buffer.cpp b/src/regex_raw_buffer.cpp index 2e3f8061..bb492297 100644 --- a/src/regex_raw_buffer.cpp +++ b/src/regex_raw_buffer.cpp @@ -32,7 +32,7 @@ namespace std{ #endif -namespace boost{ namespace re_detail{ +namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ void BOOST_REGEX_CALL raw_storage::resize(size_type n) { diff --git a/src/regex_traits_defaults.cpp b/src/regex_traits_defaults.cpp index 5f06149c..0b66c68d 100644 --- a/src/regex_traits_defaults.cpp +++ b/src/regex_traits_defaults.cpp @@ -36,7 +36,7 @@ namespace std{ #endif -namespace boost{ namespace re_detail{ +namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_syntax(regex_constants::syntax_type n) { @@ -688,5 +688,5 @@ BOOST_REGEX_DECL regex_constants::syntax_type BOOST_REGEX_CALL get_default_synta } -} // re_detail +} // BOOST_REGEX_DETAIL_NS } // boost diff --git a/src/w32_regex_traits.cpp b/src/w32_regex_traits.cpp index cf4dc10f..fdf93052 100644 --- a/src/w32_regex_traits.cpp +++ b/src/w32_regex_traits.cpp @@ -40,7 +40,7 @@ namespace std{ } #endif -namespace boost{ namespace re_detail{ +namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ #ifdef BOOST_NO_ANSI_APIS UINT get_code_page_for_locale_id(lcid_type idx) @@ -63,12 +63,12 @@ void w32_regex_traits_char_layer::init() std::string cat_name(w32_regex_traits::get_catalog_name()); if(cat_name.size()) { - cat = ::boost::re_detail::w32_cat_open(cat_name); + cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name); if(!cat) { std::string m("Unable to open message catalog: "); std::runtime_error err(m + cat_name); - ::boost::re_detail::raise_runtime_error(err); + ::boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); } } // @@ -78,7 +78,7 @@ void w32_regex_traits_char_layer::init() { for(regex_constants::syntax_type i = 1; i < regex_constants::syntax_max; ++i) { - string_type mss = ::boost::re_detail::w32_cat_get(cat, this->m_locale, i, get_default_syntax(i)); + string_type mss = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i, get_default_syntax(i)); for(string_type::size_type j = 0; j < mss.size(); ++j) { m_char_map[static_cast(mss[j])] = i; @@ -105,9 +105,9 @@ void w32_regex_traits_char_layer::init() { if(m_char_map[i] == 0) { - if(::boost::re_detail::w32_is(this->m_locale, 0x0002u, (char)i)) + if(::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, 0x0002u, (char)i)) m_char_map[i] = regex_constants::escape_type_class; - else if(::boost::re_detail::w32_is(this->m_locale, 0x0001u, (char)i)) + else if(::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, 0x0001u, (char)i)) m_char_map[i] = regex_constants::escape_type_not_class; } }while(0xFF != i++); @@ -645,7 +645,7 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type idx, boost::uint32_t m, #endif #endif -} // re_detail +} // BOOST_REGEX_DETAIL_NS } // boost #endif diff --git a/src/wc_regex_traits.cpp b/src/wc_regex_traits.cpp index 7815a09b..e7fcfb8e 100644 --- a/src/wc_regex_traits.cpp +++ b/src/wc_regex_traits.cpp @@ -117,7 +117,7 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::t c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::transform_primary(const wchar_t* p1, const wchar_t* p2) { static wchar_t s_delim; - static const int s_collate_type = ::boost::re_detail::find_sort_syntax(static_cast*>(0), &s_delim); + static const int s_collate_type = ::boost::BOOST_REGEX_DETAIL_NS::find_sort_syntax(static_cast*>(0), &s_delim); std::wstring result; // // What we do here depends upon the format of the sort key returned by @@ -125,8 +125,8 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::t // switch(s_collate_type) { - case ::boost::re_detail::sort_C: - case ::boost::re_detail::sort_unknown: + case ::boost::BOOST_REGEX_DETAIL_NS::sort_C: + case ::boost::BOOST_REGEX_DETAIL_NS::sort_unknown: // the best we can do is translate to lower case, then get a regular sort key: { result.assign(p1, p2); @@ -135,14 +135,14 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::t result = c_regex_traits::transform(&*result.begin(), &*result.begin() + result.size()); break; } - case ::boost::re_detail::sort_fixed: + case ::boost::BOOST_REGEX_DETAIL_NS::sort_fixed: { // get a regular sort key, and then truncate it: result = c_regex_traits::transform(&*result.begin(), &*result.begin() + result.size()); result.erase(s_delim); break; } - case ::boost::re_detail::sort_delim: + case ::boost::BOOST_REGEX_DETAIL_NS::sort_delim: // get a regular sort key, and then truncate everything after the delim: result = c_regex_traits::transform(&*result.begin(), &*result.begin() + result.size()); if(result.size() && (result[0] == s_delim)) @@ -189,13 +189,13 @@ c_regex_traits::char_class_type BOOST_REGEX_CALL c_regex_traits(sizeof(masks) / sizeof(masks[0]))); return masks[idx+1]; @@ -213,11 +213,11 @@ bool BOOST_REGEX_CALL c_regex_traits::isctype(wchar_t c, char_class_typ || ((mask & char_class_digit) && (std::iswdigit)(c)) || ((mask & char_class_punct) && (std::iswpunct)(c)) || ((mask & char_class_xdigit) && (std::iswxdigit)(c)) - || ((mask & char_class_blank) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c)) + || ((mask & char_class_blank) && (std::iswspace)(c) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c)) || ((mask & char_class_word) && (c == '_')) || ((mask & char_class_unicode) && (c & ~static_cast(0xff))) - || ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == L'\v'))) - || ((mask & char_class_horizontal) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c) && (c != L'\v')); + || ((mask & char_class_vertical) && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == L'\v'))) + || ((mask & char_class_horizontal) && (std::iswspace)(c) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) && (c != L'\v')); } c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::lookup_collatename(const wchar_t* p1, const wchar_t* p2) @@ -232,7 +232,7 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::l while(p0 != p2) name.append(1, char(*p0++)); #endif - name = ::boost::re_detail::lookup_default_collate_name(name); + name = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(name); #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\ && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) diff --git a/src/wide_posix_api.cpp b/src/wide_posix_api.cpp index 41704cd0..c0144bbe 100644 --- a/src/wide_posix_api.cpp +++ b/src/wide_posix_api.cpp @@ -218,12 +218,12 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* p = static_cast(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code)); else { - p = re_detail::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code)); + p = BOOST_REGEX_DETAIL_NS::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code)); } std::size_t len = p.size(); if(len < buf_size) { - re_detail::copy(p.c_str(), p.c_str() + p.size() + 1, buf); + BOOST_REGEX_DETAIL_NS::copy(p.c_str(), p.c_str() + p.size() + 1, buf); } return len + 1; } diff --git a/test/collate_info/collate_info.cpp b/test/collate_info/collate_info.cpp index ab3e1051..021a5498 100644 --- a/test/collate_info/collate_info.cpp +++ b/test/collate_info/collate_info.cpp @@ -150,24 +150,24 @@ void print_sort_syntax(const traits& pt, const char* name) std::cout << "Sort Key Syntax for type " << name << ":\n"; typedef typename traits::char_type char_type; char_type delim; - unsigned result = ::boost::re_detail::find_sort_syntax(&pt, &delim); + unsigned result = ::boost::BOOST_REGEX_DETAIL_NS::find_sort_syntax(&pt, &delim); std::cout << " "; switch(result) { - case boost::re_detail::sort_C: + case boost::BOOST_REGEX_DETAIL_NS::sort_C: std::cout << "sort_C"; break; - case boost::re_detail::sort_fixed: + case boost::BOOST_REGEX_DETAIL_NS::sort_fixed: std::cout << "sort_fixed" << " " << static_cast(delim); break; - case boost::re_detail::sort_delim: + case boost::BOOST_REGEX_DETAIL_NS::sort_delim: { std::cout << "sort_delim" << " "; std::basic_string s(1, delim); print_string(s); } break; - case boost::re_detail::sort_unknown: + case boost::BOOST_REGEX_DETAIL_NS::sort_unknown: std::cout << "sort_unknown"; break; default: diff --git a/test/regress/test_icu.cpp b/test/regress/test_icu.cpp index 2666db6e..6e21cf37 100644 --- a/test/regress/test_icu.cpp +++ b/test/regress/test_icu.cpp @@ -86,7 +86,7 @@ void compare_result(const MR1& w1, const MR2& w2, boost::mpl::int_<2> const*) { BOOST_REGEX_TEST_ERROR("Matched mismatch in match_results class", UChar32); } - if((w1.position(i) != boost::re_detail::distance(iterator_type(w2.prefix().first), iterator_type(w2[i].first))) || (w1.length(i) != boost::re_detail::distance(iterator_type(w2[i].first), iterator_type(w2[i].second)))) + if((w1.position(i) != boost::BOOST_REGEX_DETAIL_NS::distance(iterator_type(w2.prefix().first), iterator_type(w2[i].first))) || (w1.length(i) != boost::BOOST_REGEX_DETAIL_NS::distance(iterator_type(w2[i].first), iterator_type(w2[i].second)))) { BOOST_REGEX_TEST_ERROR("Iterator mismatch in match_results class", UChar32); } @@ -116,7 +116,7 @@ void compare_result(const MR1& w1, const MR2& w2, boost::mpl::int_<1> const*) { BOOST_REGEX_TEST_ERROR("Matched mismatch in match_results class", UChar32); } - if((w1.position(i) != boost::re_detail::distance(iterator_type(w2.prefix().first), iterator_type(w2[i].first))) || (w1.length(i) != boost::re_detail::distance(iterator_type(w2[i].first), iterator_type(w2[i].second)))) + if((w1.position(i) != boost::BOOST_REGEX_DETAIL_NS::distance(iterator_type(w2.prefix().first), iterator_type(w2[i].first))) || (w1.length(i) != boost::BOOST_REGEX_DETAIL_NS::distance(iterator_type(w2[i].first), iterator_type(w2[i].second)))) { BOOST_REGEX_TEST_ERROR("Iterator mismatch in match_results class", UChar32); } diff --git a/test/regress/test_mfc.cpp b/test/regress/test_mfc.cpp index fc7265b4..0d855cef 100644 --- a/test/regress/test_mfc.cpp +++ b/test/regress/test_mfc.cpp @@ -170,21 +170,21 @@ void test_mfc(const char&, const test_regex_search_tag&) #pragma warning(push) #pragma warning(disable:4244) #endif - if(boost::re_detail::distance(s.GetString(), tstart2->first) != last_end2) + if(boost::BOOST_REGEX_DETAIL_NS::distance(s.GetString(), tstart2->first) != last_end2) { BOOST_REGEX_TEST_ERROR( "Error in location of start of field split, found: " - << boost::re_detail::distance(s.GetString(), tstart2->first) + << boost::BOOST_REGEX_DETAIL_NS::distance(s.GetString(), tstart2->first) << ", expected: " << last_end2 << ".", char); } int expected_end = static_cast(answer_table[0] < 0 ? s.GetLength() : answer_table[0]); - if(boost::re_detail::distance(s.GetString(), tstart2->second) != expected_end) + if(boost::BOOST_REGEX_DETAIL_NS::distance(s.GetString(), tstart2->second) != expected_end) { BOOST_REGEX_TEST_ERROR( "Error in location of end2 of field split, found: " - << boost::re_detail::distance(s.GetString(), tstart2->second) + << boost::BOOST_REGEX_DETAIL_NS::distance(s.GetString(), tstart2->second) << ", expected: " << expected_end << ".", char); @@ -348,21 +348,21 @@ void test_mfc(const wchar_t&, const test_regex_search_tag&) #pragma warning(push) #pragma warning(disable:4244) #endif - if(boost::re_detail::distance(s.GetString(), tstart2->first) != last_end2) + if(boost::BOOST_REGEX_DETAIL_NS::distance(s.GetString(), tstart2->first) != last_end2) { BOOST_REGEX_TEST_ERROR( "Error in location of start of field split, found: " - << boost::re_detail::distance(s.GetString(), tstart2->first) + << boost::BOOST_REGEX_DETAIL_NS::distance(s.GetString(), tstart2->first) << ", expected: " << last_end2 << ".", wchar_t); } int expected_end = static_cast(answer_table[0] < 0 ? s.GetLength() : answer_table[0]); - if(boost::re_detail::distance(s.GetString(), tstart2->second) != expected_end) + if(boost::BOOST_REGEX_DETAIL_NS::distance(s.GetString(), tstart2->second) != expected_end) { BOOST_REGEX_TEST_ERROR( "Error in location of end2 of field split, found: " - << boost::re_detail::distance(s.GetString(), tstart2->second) + << boost::BOOST_REGEX_DETAIL_NS::distance(s.GetString(), tstart2->second) << ", expected: " << expected_end << ".", wchar_t); diff --git a/test/regress/test_partial_match.hpp b/test/regress/test_partial_match.hpp index 51ae5b66..19e45866 100644 --- a/test/regress/test_partial_match.hpp +++ b/test/regress/test_partial_match.hpp @@ -47,18 +47,18 @@ void test_sub_match(const boost::sub_match& sub, Bidirect } else { - if(boost::re_detail::distance(base, sub.first) != answer_table[2*i]) + if(boost::BOOST_REGEX_DETAIL_NS::distance(base, sub.first) != answer_table[2*i]) { BOOST_REGEX_TEST_ERROR( "Error in start location of sub-expression " - << i << ", found " << boost::re_detail::distance(base, sub.first) + << i << ", found " << boost::BOOST_REGEX_DETAIL_NS::distance(base, sub.first) << ", expected " << answer_table[2*i] << ".", charT); } - if(boost::re_detail::distance(base, sub.second) != answer_table[1+ 2*i]) + if(boost::BOOST_REGEX_DETAIL_NS::distance(base, sub.second) != answer_table[1+ 2*i]) { BOOST_REGEX_TEST_ERROR( "Error in end location of sub-expression " - << i << ", found " << boost::re_detail::distance(base, sub.second) + << i << ", found " << boost::BOOST_REGEX_DETAIL_NS::distance(base, sub.second) << ", expected " << answer_table[1 + 2*i] << ".", charT); } } @@ -238,21 +238,21 @@ void test_regex_token_iterator(boost::basic_regex& r) #pragma warning(push) #pragma warning(disable:4244) #endif - if(boost::re_detail::distance(search_text.begin(), start2->first) != last_end2) + if(boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->first) != last_end2) { BOOST_REGEX_TEST_ERROR( "Error in location of start of field split, found: " - << boost::re_detail::distance(search_text.begin(), start2->first) + << boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->first) << ", expected: " << last_end2 << ".", charT); } int expected_end = static_cast(answer_table[0] < 0 ? search_text.size() : answer_table[0]); - if(boost::re_detail::distance(search_text.begin(), start2->second) != expected_end) + if(boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->second) != expected_end) { BOOST_REGEX_TEST_ERROR( "Error in location of end2 of field split, found: " - << boost::re_detail::distance(search_text.begin(), start2->second) + << boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->second) << ", expected: " << expected_end << ".", charT); diff --git a/test/regress/test_regex_search.hpp b/test/regress/test_regex_search.hpp index 411d943a..16b1bf91 100644 --- a/test/regress/test_regex_search.hpp +++ b/test/regress/test_regex_search.hpp @@ -55,18 +55,18 @@ void test_sub_match(const boost::sub_match& sub, Bidirect } else { - if(boost::re_detail::distance(base, sub.first) != answer_table[2*i]) + if(boost::BOOST_REGEX_DETAIL_NS::distance(base, sub.first) != answer_table[2*i]) { BOOST_REGEX_TEST_ERROR( "Error in start location of sub-expression " - << i << ", found " << boost::re_detail::distance(base, sub.first) + << i << ", found " << boost::BOOST_REGEX_DETAIL_NS::distance(base, sub.first) << ", expected " << answer_table[2*i] << ".", charT); } - if(boost::re_detail::distance(base, sub.second) != answer_table[1+ 2*i]) + if(boost::BOOST_REGEX_DETAIL_NS::distance(base, sub.second) != answer_table[1+ 2*i]) { BOOST_REGEX_TEST_ERROR( "Error in end location of sub-expression " - << i << ", found " << boost::re_detail::distance(base, sub.second) + << i << ", found " << boost::BOOST_REGEX_DETAIL_NS::distance(base, sub.second) << ", expected " << answer_table[1 + 2*i] << ".", charT); } } @@ -291,21 +291,21 @@ void test_regex_token_iterator(boost::basic_regex& r) #pragma warning(push) #pragma warning(disable:4244) #endif - if(boost::re_detail::distance(search_text.begin(), start2->first) != last_end2) + if(boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->first) != last_end2) { BOOST_REGEX_TEST_ERROR( "Error in location of start of field split, found: " - << boost::re_detail::distance(search_text.begin(), start2->first) + << boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->first) << ", expected: " << last_end2 << ".", charT); } int expected_end = static_cast(answer_table[0] < 0 ? search_text.size() : answer_table[0]); - if(boost::re_detail::distance(search_text.begin(), start2->second) != expected_end) + if(boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->second) != expected_end) { BOOST_REGEX_TEST_ERROR( "Error in location of end2 of field split, found: " - << boost::re_detail::distance(search_text.begin(), start2->second) + << boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->second) << ", expected: " << expected_end << ".", charT); @@ -350,21 +350,21 @@ void test_regex_token_iterator(boost::basic_regex& r) #pragma warning(push) #pragma warning(disable:4244) #endif - if(boost::re_detail::distance(search_text.begin(), start2->first) != last_end2) + if(boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->first) != last_end2) { BOOST_REGEX_TEST_ERROR( "Error in location of start of field split, found: " - << boost::re_detail::distance(search_text.begin(), start2->first) + << boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->first) << ", expected: " << last_end2 << ".", charT); } int expected_end = static_cast(answer_table[0] < 0 ? search_text.size() : answer_table[0]); - if(boost::re_detail::distance(search_text.begin(), start2->second) != expected_end) + if(boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->second) != expected_end) { BOOST_REGEX_TEST_ERROR( "Error in location of end2 of field split, found: " - << boost::re_detail::distance(search_text.begin(), start2->second) + << boost::BOOST_REGEX_DETAIL_NS::distance(search_text.begin(), start2->second) << ", expected: " << expected_end << ".", charT); diff --git a/tools/generate/tables.cpp b/tools/generate/tables.cpp index cd8f51ee..34d1f9f7 100644 --- a/tools/generate/tables.cpp +++ b/tools/generate/tables.cpp @@ -75,7 +75,7 @@ void generate_code() std::cout << "};\n\n"; // now the iterator table: - std::cout << "static const re_detail::character_pointer_range<" << g_char_type << "> range_data[] = {\n"; + std::cout << "static const BOOST_REGEX_DETAIL_NS::character_pointer_range<" << g_char_type << "> range_data[] = {\n"; std::size_t index = 0; for(i = g_table.begin(), j = g_table.end(); i != j; ++i) {