AnyCollect  1.1.2
AnyCollect::Expression Class Reference

Class used to represent an expression (regex) More...

#include <Expression.h>

Collaboration diagram for AnyCollect::Expression:

Public Member Functions

 Expression (const std::string &pattern) noexcept
 Construct a new Expression object. More...
 
std::vector< std::shared_ptr< Matcher > > & matchers () noexcept
 Returns the array of the receiver's matchers. More...
 
const std::vector< std::shared_ptr< Matcher > > & matchers () const noexcept
 Returns the array of the receiver's matchers. More...
 
const std::cmatch & apply (std::string_view::const_iterator begin, std::string_view::const_iterator end)
 Apply the regex and find matches in the given string. More...
 

Protected Attributes

std::regex regex_
 Regex object. More...
 
std::vector< std::shared_ptr< Matcher > > matchers_
 Matchers associated with the receiver. More...
 

Static Protected Attributes

static std::cmatch match {}
 Object used to store regex matches. More...
 

Detailed Description

Class used to represent an expression (regex)

Definition at line 33 of file Expression.h.

Constructor & Destructor Documentation

◆ Expression()

AnyCollect::Expression::Expression ( const std::string &  pattern)
noexcept

Construct a new Expression object.

Parameters
patternregex string to use

Definition at line 27 of file Expression.cc.

Member Function Documentation

◆ apply()

const std::cmatch & AnyCollect::Expression::apply ( std::string_view::const_iterator  begin,
std::string_view::const_iterator  end 
)

Apply the regex and find matches in the given string.

Parameters
beginiterator to the beginning of the string to match
enditerator to the end of the string to match
Returns
the matches found

Definition at line 40 of file Expression.cc.

◆ matchers() [1/2]

std::vector< std::shared_ptr< Matcher > > & AnyCollect::Expression::matchers ( )
noexcept

Returns the array of the receiver's matchers.

Definition at line 32 of file Expression.cc.

◆ matchers() [2/2]

const std::vector< std::shared_ptr< Matcher > > & AnyCollect::Expression::matchers ( ) const
noexcept

Returns the array of the receiver's matchers.

Definition at line 36 of file Expression.cc.

Member Data Documentation

◆ match

std::cmatch AnyCollect::Expression::match {}
staticprotected

Object used to store regex matches.

Definition at line 35 of file Expression.h.

◆ matchers_

std::vector<std::shared_ptr<Matcher> > AnyCollect::Expression::matchers_
protected

Matchers associated with the receiver.

Definition at line 37 of file Expression.h.

◆ regex_

std::regex AnyCollect::Expression::regex_
protected

Regex object.

Definition at line 36 of file Expression.h.


The documentation for this class was generated from the following files: