irccd  3.0.3
Public Types | Public Member Functions | Public Attributes | List of all members
irccd::daemon::rule Struct Reference

Manage rule to activate or deactive events. More...

#include <rule.hpp>

Public Types

enum class  action_type { accept , drop }
 Rule action type. More...
 
using set = std::set< std::string >
 

Public Member Functions

auto match_set (const set &set, const std::string &value) const noexcept -> bool
 
auto match (std::string_view server, std::string_view channel, std::string_view origin, std::string_view plugin, std::string_view event) const noexcept -> bool
 

Public Attributes

set servers {}
 The list of servers. More...
 
set channels {}
 The list of channels. More...
 
set origins {}
 The list of originators. More...
 
set plugins {}
 The list of plugins. More...
 
set events {}
 The list of events. More...
 
action_type action {action_type::accept}
 

Detailed Description

Manage rule to activate or deactive events.

Member Typedef Documentation

◆ set

using irccd::daemon::rule::set = std::set<std::string>

List of criterias.

Member Enumeration Documentation

◆ action_type

Rule action type.

Enumerator
accept 

The event is accepted (default)

drop 

The event is dropped.

Member Function Documentation

◆ match()

auto irccd::daemon::rule::match ( std::string_view  server,
std::string_view  channel,
std::string_view  origin,
std::string_view  plugin,
std::string_view  event 
) const -> bool
noexcept

Check if that rule apply for the given criterias.

Parameters
serverthe server
channelthe channel
originthe origin
pluginthe plugin
eventthe event
Returns
true if match

◆ match_set()

auto irccd::daemon::rule::match_set ( const set set,
const std::string &  value 
) const -> bool
noexcept

Check if a set contains the value and return true if it is or return true if value is empty (which means applicable).

Parameters
setthe set to test
valuethe value
Returns
true if match

Member Data Documentation

◆ action

action_type irccd::daemon::rule::action {action_type::accept}

The action.

◆ channels

set irccd::daemon::rule::channels {}

The list of channels.

◆ events

set irccd::daemon::rule::events {}

The list of events.

◆ origins

set irccd::daemon::rule::origins {}

The list of originators.

◆ plugins

set irccd::daemon::rule::plugins {}

The list of plugins.

◆ servers

set irccd::daemon::rule::servers {}

The list of servers.


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