mirror of
https://github.com/boostorg/regex.git
synced 2025-07-24 09:37:36 +02:00
Remove external template instantiation.
This commit is contained in:
@ -103,43 +103,6 @@
|
||||
# define BOOST_REGEX_BUGGY_CTYPE_FACET
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Intel C++ before 8.0 ends up with unresolved externals unless we turn off
|
||||
* extern template support:
|
||||
*/
|
||||
#if defined(BOOST_INTEL) && defined(__cplusplus) && (BOOST_INTEL <= 800)
|
||||
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
#endif
|
||||
/*
|
||||
* Visual C++ doesn't support external templates with C++ extensions turned off:
|
||||
*/
|
||||
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
|
||||
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
#endif
|
||||
/*
|
||||
* Oracle compiler in C++11 mode doesn't like external templates for some reason:
|
||||
*/
|
||||
#ifdef __SUNPRO_CC
|
||||
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
#endif
|
||||
/*
|
||||
* Shared regex lib will crash without this, frankly it looks a lot like a gcc bug:
|
||||
*/
|
||||
#if defined(__MINGW32__)
|
||||
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
#endif
|
||||
/*
|
||||
* Clang fails to export template instances with -fvisibility=hidden, see
|
||||
* https://github.com/boostorg/regex/issues/49
|
||||
*/
|
||||
#ifdef __clang__
|
||||
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
#endif
|
||||
#ifdef __CYGWIN__
|
||||
/* We get multiply defined symbols without this: */
|
||||
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If there isn't good enough wide character support then there will
|
||||
* be no wide character regular expressions:
|
||||
@ -198,52 +161,6 @@
|
||||
# define BOOST_REGEX_NO_W32
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Wide character workarounds:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* define BOOST_REGEX_HAS_OTHER_WCHAR_T when wchar_t is a native type, but the users
|
||||
* code may be built with wchar_t as unsigned short: basically when we're building
|
||||
* with MSVC and the /Zc:wchar_t option we place some extra unsigned short versions
|
||||
* of the non-inline functions in the library, so that users can still link to the lib,
|
||||
* irrespective of whether their own code is built with /Zc:wchar_t.
|
||||
* Note that this does NOT WORK with VC10 and VC14 when the C++ locale is in effect as
|
||||
* the locale's <unsigned short> facets simply do not compile in that case.
|
||||
* As we default to the C++ locale when compiling for the windows runtime we
|
||||
* skip in this case aswell.
|
||||
*/
|
||||
#if defined(__cplusplus) && \
|
||||
(defined(BOOST_MSVC) || defined(__ICL)) && \
|
||||
!defined(BOOST_NO_INTRINSIC_WCHAR_T) && \
|
||||
defined(BOOST_WINDOWS) && \
|
||||
!defined(__SGI_STL_PORT) && \
|
||||
!defined(_STLPORT_VERSION) && \
|
||||
!defined(BOOST_RWSTD_VER) && \
|
||||
((_MSC_VER < 1600) || !defined(BOOST_REGEX_USE_CPP_LOCALE)) && \
|
||||
!BOOST_PLAT_WINDOWS_RUNTIME
|
||||
# define BOOST_REGEX_HAS_OTHER_WCHAR_T
|
||||
# ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4251)
|
||||
#if BOOST_MSVC < 1700
|
||||
# pragma warning(disable : 4231)
|
||||
#endif
|
||||
# if BOOST_MSVC < 1600
|
||||
# pragma warning(disable : 4660)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_DLL) && defined(BOOST_MSVC) && (BOOST_MSVC < 1600)
|
||||
# include <string>
|
||||
extern template class __declspec(dllimport) std::basic_string<unsigned short>;
|
||||
# endif
|
||||
# ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
@ -506,6 +423,3 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL print_regex_library_info();
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -215,24 +215,6 @@ private:
|
||||
|
||||
} // namespace boost
|
||||
|
||||
//
|
||||
// template instances:
|
||||
//
|
||||
#define BOOST_REGEX_CHAR_T UChar32
|
||||
#undef BOOST_REGEX_TRAITS_T
|
||||
#define BOOST_REGEX_TRAITS_T , icu_regex_traits
|
||||
#define BOOST_REGEX_ICU_INSTANCES
|
||||
#ifdef BOOST_REGEX_ICU_INSTANTIATE
|
||||
# define BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#include <boost/regex/v4/instances.hpp>
|
||||
#undef BOOST_REGEX_CHAR_T
|
||||
#undef BOOST_REGEX_TRAITS_T
|
||||
#undef BOOST_REGEX_ICU_INSTANCES
|
||||
#ifdef BOOST_REGEX_INSTANTIATE
|
||||
# undef BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
// types:
|
||||
|
@ -1,236 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2002
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE instances.cpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Defines those template instances that are placed in the
|
||||
* library rather than in the users object files.
|
||||
*/
|
||||
|
||||
//
|
||||
// note no include guard, we may include this multiple times:
|
||||
//
|
||||
#ifndef BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
|
||||
namespace boost{
|
||||
|
||||
//
|
||||
// this header can be included multiple times, each time with
|
||||
// a different character type, BOOST_REGEX_CHAR_T must be defined
|
||||
// first:
|
||||
//
|
||||
#ifndef BOOST_REGEX_CHAR_T
|
||||
# error "BOOST_REGEX_CHAR_T not defined"
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_REGEX_TRAITS_T
|
||||
# define BOOST_REGEX_TRAITS_T , boost::regex_traits<BOOST_REGEX_CHAR_T >
|
||||
#endif
|
||||
|
||||
//
|
||||
// what follows is compiler specific:
|
||||
//
|
||||
|
||||
#if defined(BOOST_BORLANDC) && (BOOST_BORLANDC < 0x600)
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
# ifndef BOOST_REGEX_INSTANTIATE
|
||||
# pragma option push -Jgx
|
||||
# endif
|
||||
|
||||
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::BOOST_REGEX_DETAIL_NS::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
|
||||
#endif
|
||||
|
||||
# ifndef BOOST_REGEX_INSTANTIATE
|
||||
# pragma option pop
|
||||
# endif
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#elif defined(BOOST_MSVC) || defined(__ICL)
|
||||
|
||||
# ifndef BOOST_REGEX_INSTANTIATE
|
||||
# ifdef __GNUC__
|
||||
# define template __extension__ extern template
|
||||
# else
|
||||
# if BOOST_MSVC > 1310
|
||||
# define BOOST_REGEX_TEMPLATE_DECL
|
||||
# endif
|
||||
# define template extern template
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#ifndef BOOST_REGEX_TEMPLATE_DECL
|
||||
# define BOOST_REGEX_TEMPLATE_DECL BOOST_REGEX_DECL
|
||||
#endif
|
||||
|
||||
# ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4251)
|
||||
#if BOOST_MSVC < 1700
|
||||
# pragma warning(disable : 4231)
|
||||
#endif
|
||||
# if BOOST_MSVC < 1600
|
||||
# pragma warning(disable : 4660)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
template class BOOST_REGEX_TEMPLATE_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
|
||||
|
||||
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::BOOST_REGEX_DETAIL_NS::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::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))\
|
||||
&& !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))\
|
||||
&& !defined(BOOST_REGEX_ICU_INSTANCES)
|
||||
template class BOOST_REGEX_TEMPLATE_DECL match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >;
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
# ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
# endif
|
||||
|
||||
# ifdef template
|
||||
# undef template
|
||||
# endif
|
||||
|
||||
#undef BOOST_REGEX_TEMPLATE_DECL
|
||||
|
||||
#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE)
|
||||
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
# if defined(__APPLE_CC__)
|
||||
# if (__clang_major__ > 6)
|
||||
# pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
# endif
|
||||
# else
|
||||
# if (__clang_major__ > 3) || ((__clang_major__ == 3) && (__clang_minor__ > 5))
|
||||
# pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifndef BOOST_REGEX_INSTANTIATE
|
||||
# ifdef __GNUC__
|
||||
# define template __extension__ extern template
|
||||
# else
|
||||
# define template extern template
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_REGEX_ICU_INSTANCES)
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template BOOST_REGEX_DECL
|
||||
std::locale cpp_regex_traits_base<BOOST_REGEX_CHAR_T>::imbue(const std::locale& l);
|
||||
|
||||
template BOOST_REGEX_DECL
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::transform_primary(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
|
||||
template BOOST_REGEX_DECL
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::transform(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
|
||||
template BOOST_REGEX_DECL
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::lookup_collatename(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
|
||||
template BOOST_REGEX_DECL
|
||||
void cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::init();
|
||||
template BOOST_REGEX_DECL
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::char_class_type
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::lookup_classname_imp(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
|
||||
#ifdef BOOST_REGEX_BUGGY_CTYPE_FACET
|
||||
template BOOST_REGEX_DECL
|
||||
bool cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::isctype(const BOOST_REGEX_CHAR_T c, char_class_type mask) const;
|
||||
#endif
|
||||
} // namespace
|
||||
template BOOST_REGEX_DECL
|
||||
boost::intmax_t cpp_regex_traits<BOOST_REGEX_CHAR_T>::toi(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last, int radix)const;
|
||||
template BOOST_REGEX_DECL
|
||||
std::string cpp_regex_traits<BOOST_REGEX_CHAR_T>::catalog_name(const std::string& name);
|
||||
template BOOST_REGEX_DECL
|
||||
std::string& cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_catalog_name_inst();
|
||||
template BOOST_REGEX_DECL
|
||||
std::string cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_catalog_name();
|
||||
#ifdef BOOST_HAS_THREADS
|
||||
template BOOST_REGEX_DECL
|
||||
static_mutex& cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_mutex_inst();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
template BOOST_REGEX_DECL basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >&
|
||||
basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::do_assign(
|
||||
const BOOST_REGEX_CHAR_T* p1,
|
||||
const BOOST_REGEX_CHAR_T* p2,
|
||||
flag_type f);
|
||||
template BOOST_REGEX_DECL basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::locale_type BOOST_REGEX_CALL
|
||||
basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::imbue(locale_type l);
|
||||
|
||||
template BOOST_REGEX_DECL void BOOST_REGEX_CALL
|
||||
match_results<const BOOST_REGEX_CHAR_T*>::maybe_assign(
|
||||
const match_results<const BOOST_REGEX_CHAR_T*>& m);
|
||||
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template BOOST_REGEX_DECL void perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::construct_init(
|
||||
const basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >& e, match_flag_type f);
|
||||
template BOOST_REGEX_DECL bool perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::match();
|
||||
template BOOST_REGEX_DECL bool perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::find();
|
||||
} // namespace
|
||||
|
||||
#if (defined(__GLIBCPP__) || defined(__GLIBCXX__)) \
|
||||
&& !defined(BOOST_REGEX_ICU_INSTANCES)\
|
||||
&& !defined(__SGI_STL_PORT)\
|
||||
&& !defined(_STLPORT_VERSION)
|
||||
// std:basic_string<>::const_iterator instances as well:
|
||||
template BOOST_REGEX_DECL void BOOST_REGEX_CALL
|
||||
match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::maybe_assign(
|
||||
const match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>& m);
|
||||
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template BOOST_REGEX_DECL void perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::construct_init(
|
||||
const basic_regex<BOOST_REGEX_CHAR_T>& e, match_flag_type f);
|
||||
template BOOST_REGEX_DECL bool perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::match();
|
||||
template BOOST_REGEX_DECL bool perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::find();
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
# ifdef template
|
||||
# undef template
|
||||
# endif
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -87,42 +87,6 @@
|
||||
#ifndef BOOST_REGEX_MATCHER_HPP
|
||||
#include <boost/regex/v4/perl_matcher.hpp>
|
||||
#endif
|
||||
//
|
||||
// template instances:
|
||||
//
|
||||
#define BOOST_REGEX_CHAR_T char
|
||||
#ifdef BOOST_REGEX_NARROW_INSTANTIATE
|
||||
# define BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#include <boost/regex/v4/instances.hpp>
|
||||
#undef BOOST_REGEX_CHAR_T
|
||||
#ifdef BOOST_REGEX_INSTANTIATE
|
||||
# undef BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
#define BOOST_REGEX_CHAR_T wchar_t
|
||||
#ifdef BOOST_REGEX_WIDE_INSTANTIATE
|
||||
# define BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#include <boost/regex/v4/instances.hpp>
|
||||
#undef BOOST_REGEX_CHAR_T
|
||||
#ifdef BOOST_REGEX_INSTANTIATE
|
||||
# undef BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_WREGEX) && defined(BOOST_REGEX_HAS_OTHER_WCHAR_T)
|
||||
#define BOOST_REGEX_CHAR_T unsigned short
|
||||
#ifdef BOOST_REGEX_US_INSTANTIATE
|
||||
# define BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#include <boost/regex/v4/instances.hpp>
|
||||
#undef BOOST_REGEX_CHAR_T
|
||||
#ifdef BOOST_REGEX_INSTANTIATE
|
||||
# undef BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost{
|
||||
|
@ -200,131 +200,5 @@ BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW*);
|
||||
} /* namespace */
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
/*
|
||||
* C++ high level wrapper goes here:
|
||||
*/
|
||||
#include <string>
|
||||
#include <vector>
|
||||
namespace boost{
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4103)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
class RegEx;
|
||||
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
class RegExData;
|
||||
struct pred1;
|
||||
struct pred2;
|
||||
struct pred3;
|
||||
struct pred4;
|
||||
|
||||
} /* namespace BOOST_REGEX_DETAIL_NS */
|
||||
|
||||
#if (defined(BOOST_MSVC) || defined(BOOST_BORLANDC)) && !defined(BOOST_DISABLE_WIN32)
|
||||
typedef bool (__cdecl *GrepCallback)(const RegEx& expression);
|
||||
typedef bool (__cdecl *GrepFileCallback)(const char* file, const RegEx& expression);
|
||||
typedef bool (__cdecl *FindFilesCallback)(const char* file);
|
||||
#else
|
||||
typedef bool (*GrepCallback)(const RegEx& expression);
|
||||
typedef bool (*GrepFileCallback)(const char* file, const RegEx& expression);
|
||||
typedef bool (*FindFilesCallback)(const char* file);
|
||||
#endif
|
||||
|
||||
class BOOST_REGEX_DECL RegEx
|
||||
{
|
||||
private:
|
||||
BOOST_REGEX_DETAIL_NS::RegExData* pdata;
|
||||
public:
|
||||
RegEx();
|
||||
RegEx(const RegEx& o);
|
||||
~RegEx();
|
||||
explicit RegEx(const char* c, bool icase = false);
|
||||
explicit RegEx(const std::string& s, bool icase = false);
|
||||
RegEx& operator=(const RegEx& o);
|
||||
RegEx& operator=(const char* p);
|
||||
RegEx& operator=(const std::string& s){ return this->operator=(s.c_str()); }
|
||||
unsigned int SetExpression(const char* p, bool icase = false);
|
||||
unsigned int SetExpression(const std::string& s, bool icase = false){ return SetExpression(s.c_str(), icase); }
|
||||
std::string Expression()const;
|
||||
unsigned int error_code()const;
|
||||
/*
|
||||
* now matching operators:
|
||||
*/
|
||||
bool Match(const char* p, match_flag_type flags = match_default);
|
||||
bool Match(const std::string& s, match_flag_type flags = match_default) { return Match(s.c_str(), flags); }
|
||||
bool Search(const char* p, match_flag_type flags = match_default);
|
||||
bool Search(const std::string& s, match_flag_type flags = match_default) { return Search(s.c_str(), flags); }
|
||||
unsigned int Grep(GrepCallback cb, const char* p, match_flag_type flags = match_default);
|
||||
unsigned int Grep(GrepCallback cb, const std::string& s, match_flag_type flags = match_default) { return Grep(cb, s.c_str(), flags); }
|
||||
unsigned int Grep(std::vector<std::string>& v, const char* p, match_flag_type flags = match_default);
|
||||
unsigned int Grep(std::vector<std::string>& v, const std::string& s, match_flag_type flags = match_default) { return Grep(v, s.c_str(), flags); }
|
||||
unsigned int Grep(std::vector<std::size_t>& v, const char* p, match_flag_type flags = match_default);
|
||||
unsigned int Grep(std::vector<std::size_t>& v, const std::string& s, match_flag_type flags = match_default) { return Grep(v, s.c_str(), flags); }
|
||||
#ifndef BOOST_REGEX_NO_FILEITER
|
||||
unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, match_flag_type flags = match_default);
|
||||
unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, match_flag_type flags = match_default) { return GrepFiles(cb, files.c_str(), recurse, flags); }
|
||||
unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, match_flag_type flags = match_default);
|
||||
unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, match_flag_type flags = match_default) { return FindFiles(cb, files.c_str(), recurse, flags); }
|
||||
#endif
|
||||
|
||||
std::string Merge(const std::string& in, const std::string& fmt,
|
||||
bool copy = true, match_flag_type flags = match_default);
|
||||
std::string Merge(const char* in, const char* fmt,
|
||||
bool copy = true, match_flag_type flags = match_default);
|
||||
|
||||
std::size_t Split(std::vector<std::string>& v, std::string& s, match_flag_type flags = match_default, unsigned max_count = ~0);
|
||||
/*
|
||||
* now operators for returning what matched in more detail:
|
||||
*/
|
||||
std::size_t Position(int i = 0)const;
|
||||
std::size_t Length(int i = 0)const;
|
||||
bool Matched(int i = 0)const;
|
||||
std::size_t Marks()const;
|
||||
std::string What(int i = 0)const;
|
||||
std::string operator[](int i)const { return What(i); }
|
||||
|
||||
static const std::size_t npos;
|
||||
|
||||
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
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4103)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* include guard */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,236 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2002
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE instances.cpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Defines those template instances that are placed in the
|
||||
* library rather than in the users object files.
|
||||
*/
|
||||
|
||||
//
|
||||
// note no include guard, we may include this multiple times:
|
||||
//
|
||||
#ifndef BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
|
||||
namespace boost{
|
||||
|
||||
//
|
||||
// this header can be included multiple times, each time with
|
||||
// a different character type, BOOST_REGEX_CHAR_T must be defined
|
||||
// first:
|
||||
//
|
||||
#ifndef BOOST_REGEX_CHAR_T
|
||||
# error "BOOST_REGEX_CHAR_T not defined"
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_REGEX_TRAITS_T
|
||||
# define BOOST_REGEX_TRAITS_T , boost::regex_traits<BOOST_REGEX_CHAR_T >
|
||||
#endif
|
||||
|
||||
//
|
||||
// what follows is compiler specific:
|
||||
//
|
||||
|
||||
#if defined(BOOST_BORLANDC) && (BOOST_BORLANDC < 0x600)
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
# ifndef BOOST_REGEX_INSTANTIATE
|
||||
# pragma option push -Jgx
|
||||
# endif
|
||||
|
||||
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::BOOST_REGEX_DETAIL_NS::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
|
||||
#endif
|
||||
|
||||
# ifndef BOOST_REGEX_INSTANTIATE
|
||||
# pragma option pop
|
||||
# endif
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#elif defined(BOOST_MSVC) || defined(__ICL)
|
||||
|
||||
# ifndef BOOST_REGEX_INSTANTIATE
|
||||
# ifdef __GNUC__
|
||||
# define template __extension__ extern template
|
||||
# else
|
||||
# if BOOST_MSVC > 1310
|
||||
# define BOOST_REGEX_TEMPLATE_DECL
|
||||
# endif
|
||||
# define template extern template
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#ifndef BOOST_REGEX_TEMPLATE_DECL
|
||||
# define BOOST_REGEX_TEMPLATE_DECL BOOST_REGEX_DECL
|
||||
#endif
|
||||
|
||||
# ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4251)
|
||||
#if BOOST_MSVC < 1700
|
||||
# pragma warning(disable : 4231)
|
||||
#endif
|
||||
# if BOOST_MSVC < 1600
|
||||
# pragma warning(disable : 4660)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
template class BOOST_REGEX_TEMPLATE_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
|
||||
|
||||
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::BOOST_REGEX_DETAIL_NS::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::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))\
|
||||
&& !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))\
|
||||
&& !defined(BOOST_REGEX_ICU_INSTANCES)
|
||||
template class BOOST_REGEX_TEMPLATE_DECL match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >;
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
# ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
# endif
|
||||
|
||||
# ifdef template
|
||||
# undef template
|
||||
# endif
|
||||
|
||||
#undef BOOST_REGEX_TEMPLATE_DECL
|
||||
|
||||
#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE)
|
||||
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
# if defined(__APPLE_CC__)
|
||||
# if (__clang_major__ > 6)
|
||||
# pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
# endif
|
||||
# else
|
||||
# if (__clang_major__ > 3) || ((__clang_major__ == 3) && (__clang_minor__ > 5))
|
||||
# pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifndef BOOST_REGEX_INSTANTIATE
|
||||
# ifdef __GNUC__
|
||||
# define template __extension__ extern template
|
||||
# else
|
||||
# define template extern template
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_REGEX_ICU_INSTANCES)
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template BOOST_REGEX_DECL
|
||||
std::locale cpp_regex_traits_base<BOOST_REGEX_CHAR_T>::imbue(const std::locale& l);
|
||||
|
||||
template BOOST_REGEX_DECL
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::transform_primary(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
|
||||
template BOOST_REGEX_DECL
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::transform(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
|
||||
template BOOST_REGEX_DECL
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::lookup_collatename(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
|
||||
template BOOST_REGEX_DECL
|
||||
void cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::init();
|
||||
template BOOST_REGEX_DECL
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::char_class_type
|
||||
cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::lookup_classname_imp(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
|
||||
#ifdef BOOST_REGEX_BUGGY_CTYPE_FACET
|
||||
template BOOST_REGEX_DECL
|
||||
bool cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::isctype(const BOOST_REGEX_CHAR_T c, char_class_type mask) const;
|
||||
#endif
|
||||
} // namespace
|
||||
template BOOST_REGEX_DECL
|
||||
boost::intmax_t cpp_regex_traits<BOOST_REGEX_CHAR_T>::toi(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last, int radix)const;
|
||||
template BOOST_REGEX_DECL
|
||||
std::string cpp_regex_traits<BOOST_REGEX_CHAR_T>::catalog_name(const std::string& name);
|
||||
template BOOST_REGEX_DECL
|
||||
std::string& cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_catalog_name_inst();
|
||||
template BOOST_REGEX_DECL
|
||||
std::string cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_catalog_name();
|
||||
#ifdef BOOST_HAS_THREADS
|
||||
template BOOST_REGEX_DECL
|
||||
static_mutex& cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_mutex_inst();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
template BOOST_REGEX_DECL basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >&
|
||||
basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::do_assign(
|
||||
const BOOST_REGEX_CHAR_T* p1,
|
||||
const BOOST_REGEX_CHAR_T* p2,
|
||||
flag_type f);
|
||||
template BOOST_REGEX_DECL basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::locale_type BOOST_REGEX_CALL
|
||||
basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::imbue(locale_type l);
|
||||
|
||||
template BOOST_REGEX_DECL void BOOST_REGEX_CALL
|
||||
match_results<const BOOST_REGEX_CHAR_T*>::maybe_assign(
|
||||
const match_results<const BOOST_REGEX_CHAR_T*>& m);
|
||||
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template BOOST_REGEX_DECL void perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::construct_init(
|
||||
const basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >& e, match_flag_type f);
|
||||
template BOOST_REGEX_DECL bool perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::match();
|
||||
template BOOST_REGEX_DECL bool perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::find();
|
||||
} // namespace
|
||||
|
||||
#if (defined(__GLIBCPP__) || defined(__GLIBCXX__)) \
|
||||
&& !defined(BOOST_REGEX_ICU_INSTANCES)\
|
||||
&& !defined(__SGI_STL_PORT)\
|
||||
&& !defined(_STLPORT_VERSION)
|
||||
// std:basic_string<>::const_iterator instances as well:
|
||||
template BOOST_REGEX_DECL void BOOST_REGEX_CALL
|
||||
match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::maybe_assign(
|
||||
const match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>& m);
|
||||
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
template BOOST_REGEX_DECL void perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::construct_init(
|
||||
const basic_regex<BOOST_REGEX_CHAR_T>& e, match_flag_type f);
|
||||
template BOOST_REGEX_DECL bool perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::match();
|
||||
template BOOST_REGEX_DECL bool perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::find();
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
# ifdef template
|
||||
# undef template
|
||||
# endif
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -87,43 +87,6 @@
|
||||
#ifndef BOOST_REGEX_MATCHER_HPP
|
||||
#include <boost/regex/v5/perl_matcher.hpp>
|
||||
#endif
|
||||
//
|
||||
// template instances:
|
||||
//
|
||||
#define BOOST_REGEX_CHAR_T char
|
||||
#ifdef BOOST_REGEX_NARROW_INSTANTIATE
|
||||
# define BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#include <boost/regex/v5/instances.hpp>
|
||||
#undef BOOST_REGEX_CHAR_T
|
||||
#ifdef BOOST_REGEX_INSTANTIATE
|
||||
# undef BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
#define BOOST_REGEX_CHAR_T wchar_t
|
||||
#ifdef BOOST_REGEX_WIDE_INSTANTIATE
|
||||
# define BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#include <boost/regex/v5/instances.hpp>
|
||||
#undef BOOST_REGEX_CHAR_T
|
||||
#ifdef BOOST_REGEX_INSTANTIATE
|
||||
# undef BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_WREGEX) && defined(BOOST_REGEX_HAS_OTHER_WCHAR_T)
|
||||
#define BOOST_REGEX_CHAR_T unsigned short
|
||||
#ifdef BOOST_REGEX_US_INSTANTIATE
|
||||
# define BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#include <boost/regex/v5/instances.hpp>
|
||||
#undef BOOST_REGEX_CHAR_T
|
||||
#ifdef BOOST_REGEX_INSTANTIATE
|
||||
# undef BOOST_REGEX_INSTANTIATE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost{
|
||||
#ifdef BOOST_REGEX_NO_FWD
|
||||
|
Reference in New Issue
Block a user