Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits > Struct Template Reference

Class template regex_compiler is a factory for building basic_regex objects from a string. More...

#include <xpressive_fwd.hpp>

Public Types

typedef BidiIter iterator_type
 
typedef iterator_value
< BidiIter >::type 
char_type
 
typedef
regex_constants::syntax_option_type 
flag_type
 
typedef RegexTraits traits_type
 
typedef traits_type::string_type string_type
 
typedef traits_type::locale_type locale_type
 
typedef
traits_type::char_class_type 
char_class_type
 

Public Member Functions

 regex_compiler (RegexTraits const &traits=RegexTraits())
 
locale_type imbue (locale_type loc)
 Specify the locale to be used by a regex_compiler. More...
 
locale_type getloc () const
 Get the locale used by a regex_compiler. More...
 
template<typename InputIter >
basic_regex< BidiIter > compile (InputIter begin, InputIter end, flag_type flags=regex_constants::ECMAScript)
 Builds a basic_regex object from a range of characters. More...
 
template<typename InputRange >
disable_if< is_pointer
< InputRange >, basic_regex
< BidiIter > >::type 
compile (InputRange const &pat, flag_type flags=regex_constants::ECMAScript)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
basic_regex< BidiIter > compile (char_type const *begin, flag_type flags=regex_constants::ECMAScript)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
basic_regex< BidiIter > compile (char_type const *begin, std::size_t size, flag_type flags)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
basic_regex< BidiIter > & operator[] (string_type const &name)
 Return a reference to the named regular expression. More...
 
basic_regex< BidiIter > const & operator[] (string_type const &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 

Detailed Description

template<typename BidiIter, typename RegexTraits, typename CompilerTraits>
struct boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >

Class template regex_compiler is a factory for building basic_regex objects from a string.

Class template regex_compiler is used to construct a basic_regex object from a string. The string should contain a valid regular expression. You can imbue a regex_compiler object with a locale, after which all basic_regex objects created with that regex_compiler object will use that locale. After creating a regex_compiler object, and optionally imbueing it with a locale, you can call the compile() method to construct a basic_regex object, passing it the string representing the regular expression. You can call compile() multiple times on the same regex_compiler object. Two basic_regex objects compiled from the same string will have different regex_id's.

Member Typedef Documentation

template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
typedef traits_type::char_class_type boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::char_class_type
template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
typedef iterator_value<BidiIter>::type boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::char_type
template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
typedef regex_constants::syntax_option_type boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::flag_type
template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
typedef BidiIter boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::iterator_type
template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
typedef traits_type::locale_type boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::locale_type
template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
typedef traits_type::string_type boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::string_type
template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
typedef RegexTraits boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::traits_type

Constructor & Destructor Documentation

template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::regex_compiler ( RegexTraits const &  traits = RegexTraits())
inlineexplicit

Member Function Documentation

template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
template<typename InputIter >
basic_regex<BidiIter> boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::compile ( InputIter  begin,
InputIter  end,
flag_type  flags = regex_constants::ECMAScript 
)
inline

Builds a basic_regex object from a range of characters.

Parameters
beginThe beginning of a range of characters representing the regular expression to compile.
endThe end of a range of characters representing the regular expression to compile.
flagsOptional bitmask that determines how the pat string is interpreted. (See syntax_option_type.)
Returns
A basic_regex object corresponding to the regular expression represented by the character range.
Precondition
InputIter is a model of the InputIterator concept.
[begin,end) is a valid range.
The range of characters specified by [begin,end) contains a valid string-based representation of a regular expression.
Exceptions
regex_errorwhen the range of characters has invalid regular expression syntax.

References boost::detail::type.

Referenced by boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::compile().

template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
template<typename InputRange >
disable_if<is_pointer<InputRange>, basic_regex<BidiIter> >::type boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::compile ( InputRange const &  pat,
flag_type  flags = regex_constants::ECMAScript 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References boost::asio::begin, boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::compile(), and boost::end.

template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
basic_regex<BidiIter> boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::compile ( char_type const *  begin,
flag_type  flags = regex_constants::ECMAScript 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References BOOST_ASSERT, boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::compile(), and boost::end.

template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
basic_regex<BidiIter> boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::compile ( char_type const *  begin,
std::size_t  size,
flag_type  flags 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References BOOST_ASSERT, boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::compile(), boost::end, and boost::size().

template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
locale_type boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::getloc ( ) const
inline

Get the locale used by a regex_compiler.

Returns
The locale used by this regex_compiler.
template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
locale_type boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::imbue ( locale_type  loc)
inline

Specify the locale to be used by a regex_compiler.

Parameters
locThe locale that this regex_compiler should use.
Returns
The previous locale.

References boost::xpressive::lookup_classname().

template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
basic_regex<BidiIter>& boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::operator[] ( string_type const &  name)
inline

Return a reference to the named regular expression.

If no such named regular expression exists, create a new regular expression and return a reference to it.

Parameters
nameA std::string containing the name of the regular expression.
Precondition
The string is not empty.
Exceptions
bad_allocon allocation failure.

References BOOST_ASSERT, and boost::iostreams::gzip::flags::name.

template<typename BidiIter , typename RegexTraits , typename CompilerTraits >
basic_regex<BidiIter> const& boost::xpressive::regex_compiler< BidiIter, RegexTraits, CompilerTraits >::operator[] ( string_type const &  name) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References BOOST_ASSERT, and boost::iostreams::gzip::flags::name.


The documentation for this struct was generated from the following file: