Chatterino
Public Member Functions | List of all members
chatterino::RegexPredicate Class Reference

MessagePredicate checking whether the message matches a given regex. More...

#include <RegexPredicate.hpp>

Inheritance diagram for chatterino::RegexPredicate:
[legend]
Collaboration diagram for chatterino::RegexPredicate:
[legend]

Public Member Functions

 RegexPredicate (const QString &regex)
 Create a RegexPredicate with a regex to match the message against. More...
 
bool appliesTo (const Message &message)
 Checks whether the message matches the regex passed in the constructor. More...
 
- Public Member Functions inherited from chatterino::MessagePredicate
virtual ~MessagePredicate ()=default
 

Detailed Description

MessagePredicate checking whether the message matches a given regex.

This predicate will only allow messages whose messageText match the given regex.

Constructor & Destructor Documentation

◆ RegexPredicate()

chatterino::RegexPredicate::RegexPredicate ( const QString &  regex)

Create a RegexPredicate with a regex to match the message against.

The message is being matched case-insensitively.

Parameters
regexthe regex to match the message against

Member Function Documentation

◆ appliesTo()

bool chatterino::RegexPredicate::appliesTo ( const Message message)
virtual

Checks whether the message matches the regex passed in the constructor.

The check is done case-insensitively.

Parameters
messagethe message to check
Returns
true if the message matches the regex, false otherwise

Implements chatterino::MessagePredicate.


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