Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-16 09:04:49

0001 //  Boost string_algo library regex_find_format.hpp header file  ---------------------------//
0002 
0003 //  Copyright Pavol Droba 2002-2003.
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 //    (See accompanying file LICENSE_1_0.txt or copy at
0007 //          http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 //  See http://www.boost.org/ for updates, documentation, and revision history.
0010 
0011 #ifndef BOOST_STRING_REGEX_FIND_FORMAT_HPP
0012 #define BOOST_STRING_REGEX_FIND_FORMAT_HPP
0013 
0014 #include <boost/algorithm/string/config.hpp>
0015 #include <boost/regex.hpp>
0016 #include <boost/algorithm/string/detail/finder_regex.hpp>
0017 #include <boost/algorithm/string/detail/formatter_regex.hpp>
0018 
0019 /*! \file
0020     Defines the \c regex_finder and \c regex_formatter generators. These two functors
0021     are designed to work together. \c regex_formatter uses additional information
0022     about a match contained in the regex_finder search result.
0023 */
0024 
0025 namespace boost {
0026     namespace algorithm {
0027 
0028 //  regex_finder  -----------------------------------------------//
0029 
0030         //! "Regex" finder 
0031         /*!
0032             Construct the \c regex_finder. Finder uses the regex engine to search
0033             for a match.
0034             Result is given in \c regex_search_result. This is an extension
0035             of the iterator_range. In addition it contains match results 
0036             from the \c regex_search algorithm.
0037 
0038             \param Rx A regular expression
0039             \param MatchFlags Regex search options
0040             \return An instance of the \c regex_finder object
0041         */
0042         template< 
0043             typename CharT, 
0044             typename RegexTraitsT>
0045         inline detail::find_regexF< basic_regex<CharT, RegexTraitsT> >
0046         regex_finder(
0047             const basic_regex<CharT, RegexTraitsT>& Rx,
0048             match_flag_type MatchFlags=match_default )
0049         {
0050             return detail::
0051                 find_regexF< 
0052                     basic_regex<CharT, RegexTraitsT> >( Rx, MatchFlags );
0053         }
0054 
0055 //  regex_formater  ---------------------------------------------//
0056 
0057         //! Regex formatter
0058         /*!
0059             Construct the \c regex_formatter. Regex formatter uses the regex engine to
0060             format a match found by the \c regex_finder. 
0061             This formatted it designed to closely cooperate with \c regex_finder.
0062 
0063             \param Format Regex format definition
0064             \param Flags Format flags
0065             \return An instance of the \c regex_formatter functor
0066         */
0067        template< 
0068             typename CharT, 
0069             typename TraitsT, typename AllocT >
0070         inline detail::regex_formatF< std::basic_string< CharT, TraitsT, AllocT > >
0071         regex_formatter( 
0072             const std::basic_string<CharT, TraitsT, AllocT>& Format,
0073             match_flag_type Flags=format_default )
0074         {
0075             return 
0076                 detail::regex_formatF< std::basic_string<CharT, TraitsT, AllocT> >(
0077                     Format,
0078                     Flags );
0079         }
0080 
0081     } // namespace algorithm
0082 
0083     // pull the names to the boost namespace
0084     using algorithm::regex_finder;
0085     using algorithm::regex_formatter;
0086 
0087 } // namespace boost
0088 
0089 
0090 #endif  // BOOST_STRING_REGEX_FIND_FORMAT_HPP