From 2035a495332829e00fb4b18d93d243fc4b2e90ac Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 1 Apr 2002 11:46:04 +0000 Subject: [PATCH] Added support for regex_fwd.hpp [SVN r13333] --- include/boost/cregex.hpp | 2 +- include/boost/regex.hpp | 10 ++++-- include/boost/regex_fwd.hpp | 69 +++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 include/boost/regex_fwd.hpp diff --git a/include/boost/cregex.hpp b/include/boost/cregex.hpp index 3a6f4502..decfd1f4 100644 --- a/include/boost/cregex.hpp +++ b/include/boost/cregex.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE cregex.cpp - * VERSION 3.12 + * VERSION see * DESCRIPTION: Declares POSIX API functions * + boost::RegEx high level wrapper. */ diff --git a/include/boost/regex.hpp b/include/boost/regex.hpp index 6d00503b..e9ec443a 100644 --- a/include/boost/regex.hpp +++ b/include/boost/regex.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex.cpp - * VERSION 3.12 + * VERSION see * DESCRIPTION: Declares boost::reg_expression<> and associated * functions and classes. This header is the main * entry point for the template regex code. @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -458,7 +459,11 @@ class match_results; namespace{ #endif +#ifdef BOOST_REGEX_NO_FWD template , class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) > +#else +template +#endif class reg_expression : public regbase { typedef typename traits::size_type traits_size_type; @@ -1529,11 +1534,12 @@ iterator BOOST_REGEX_CALL re_is_set_member(iterator next, #include namespace boost{ - +#ifdef BOOST_REGEX_NO_FWD typedef reg_expression, BOOST_DEFAULT_ALLOCATOR(char)> regex; #ifndef BOOST_NO_WREGEX typedef reg_expression, BOOST_DEFAULT_ALLOCATOR(wchar_t)> wregex; #endif +#endif typedef match_results cmatch; typedef match_results smatch; diff --git a/include/boost/regex_fwd.hpp b/include/boost/regex_fwd.hpp new file mode 100644 index 00000000..7061f4c4 --- /dev/null +++ b/include/boost/regex_fwd.hpp @@ -0,0 +1,69 @@ +/* + * + * Copyright (c) 1998-2000 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * LOCATION: see http://www.boost.org for most recent version. + * FILE regex_fwd.cpp + * VERSION see + * DESCRIPTION: Forward declares boost::reg_expression<> and + * associated typedefs. + */ + +#ifndef BOOST_REGEX_FWD_HPP +#define BOOST_REGEX_FWD_HPP + +#include +#include + +// +// define BOOST_REGEX_NO_FWD if this +// header doesn't work! +// +#ifdef __CYGWIN__ +# define BOOST_REGEX_NO_FWD +#endif + +#ifdef BOOST_REGEX_NO_FWD +# ifndef BOOST_RE_REGEX_HPP +# include +# endif +#else + +// +// If there isn't good enough wide character support then there will +// be no wide character regular expressions: +// +#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) && !defined(BOOST_NO_WREGEX) +# define BOOST_NO_WREGEX +#endif + +namespace boost{ + +template +class regex_traits; + +template , class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) > +class reg_expression; + +typedef reg_expression, BOOST_DEFAULT_ALLOCATOR(char)> regex; +#ifndef BOOST_NO_WREGEX +typedef reg_expression, BOOST_DEFAULT_ALLOCATOR(wchar_t)> wregex; +#endif + +} // namespace boost + +#endif // BOOST_REGEX_NO_FWD + +#endif \ No newline at end of file