ircproxy  The Ultimate Cyborg

MatchRequest Class Reference

#include <Matcher.h>

List of all members.


Detailed Description

A match request.

Definition at line 262 of file Matcher.h.


Public Member Functions

 MatchRequest (bool sink=false)
 Construct a MatchRequest instance.
MatchRequestoperator() (int command)
 Request a match event for command command.
MatchRequestanystring (int param, bool single_param=true)
 Request a match for any string at parameter param (and on if single_param is false).
MatchRequestnonemptystring (int param, bool single_param=true)
 Request a match event for any non-empty string at parameter param (and on if single_param is false).
MatchRequestanyserver (int param)
 Request a match if parameter param contains any server name.
MatchRequestlocalserver (int param)
 Request a match if parameter param contains our server.
MatchRequestanynick (int param)
 Request a match if parameter param contains any nick name.
MatchRequestmynick (int param)
 Request a match if parameter param contains our nick name.
MatchRequestanychannel (int param)
 Request a match if parameter param contains any channel name.
MatchRequestanyglobalchannel (int param)
 Request a match if parameter param contains any global channel name.
MatchRequestanylocalchannel (int param)
 Request a match if parameter param contains any local channel name.
MatchRequestwildcard (std::string const &arg, int param, bool single_param=true)
 Request a match if parameter param (and on if single_param is false) matches mask arg.
MatchRequestregexp (std::string const &arg, int param, bool single_param=true)
 Request a match if parameter param (and on if single_param is false) matches regular expression arg.
MatchRequestexactmatch (std::string const &arg, int param, bool single_param=true)
 Request a match if parameter param (and on if single_param is false) matches the string arg exactly.
bool is_match (ServerMessageIn const &msg) const
 Returns true if all match conditions are fullfilled.
MatchRequestList const & match_request_list (void) const
 For debugging purposes. Returns the internal MatchRequestList.

Private Attributes

boost::shared_ptr
< MatchRequestList
M_match_request_list
 Shared pointer to the match request list.

Constructor & Destructor Documentation

MatchRequest::MatchRequest ( bool  sink = false  )  [inline]

Construct a MatchRequest instance.

Definition at line 268 of file Matcher.h.

00268 : M_match_request_list(NEW(MatchRequestList)), M_sink(sink) { }


Member Function Documentation

MatchRequest& MatchRequest::operator() ( int  command  )  [inline]

Request a match event for command command.

Definition at line 271 of file Matcher.h.

00272     {
00273       M_match_request_list->M_conditions.clear();
00274       M_match_request_list->M_command = command;
00275       return *this;
00276     }

MatchRequest& MatchRequest::anystring ( int  param,
bool  single_param = true 
) [inline]

Request a match for any string at parameter param (and on if single_param is false).

Definition at line 278 of file Matcher.h.

References Matcher::create().

00279     {
00280       M_match_request_list->M_conditions.insert(Matcher::create(param, anystring_mt, single_param));
00281       return *this;
00282     }

MatchRequest& MatchRequest::nonemptystring ( int  param,
bool  single_param = true 
) [inline]

Request a match event for any non-empty string at parameter param (and on if single_param is false).

Definition at line 284 of file Matcher.h.

References Matcher::create().

00285     {
00286       M_match_request_list->M_conditions.insert(Matcher::create(param, nonemptystring_mt, single_param));
00287       return *this;
00288     }

MatchRequest& MatchRequest::anyserver ( int  param  )  [inline]

Request a match if parameter param contains any server name.

Definition at line 290 of file Matcher.h.

References Matcher::create().

00291     {
00292       M_match_request_list->M_conditions.insert(Matcher::create(param, anyserver_mt, true));
00293       return *this;
00294     }

MatchRequest& MatchRequest::localserver ( int  param  )  [inline]

Request a match if parameter param contains our server.

Definition at line 296 of file Matcher.h.

References Matcher::create().

00297     {
00298       M_match_request_list->M_conditions.insert(Matcher::create(param, localserver_mt, true));
00299       return *this;
00300     }

MatchRequest& MatchRequest::anynick ( int  param  )  [inline]

Request a match if parameter param contains any nick name.

Definition at line 302 of file Matcher.h.

References Matcher::create().

00303     {
00304       M_match_request_list->M_conditions.insert(Matcher::create(param, anynick_mt, true));
00305       return *this;
00306     }

MatchRequest& MatchRequest::mynick ( int  param  )  [inline]

Request a match if parameter param contains our nick name.

Definition at line 308 of file Matcher.h.

References Matcher::create().

Referenced by ServerConnection::send_pong_and_mode().

00309     {
00310       M_match_request_list->M_conditions.insert(Matcher::create(param, mynick_mt, true));
00311       return *this;
00312     }

MatchRequest& MatchRequest::anychannel ( int  param  )  [inline]

Request a match if parameter param contains any channel name.

Definition at line 314 of file Matcher.h.

References Matcher::create().

00315     {
00316       M_match_request_list->M_conditions.insert(Matcher::create(param, anychannel_mt, true));
00317       return *this;
00318     }

MatchRequest& MatchRequest::anyglobalchannel ( int  param  )  [inline]

Request a match if parameter param contains any global channel name.

Definition at line 320 of file Matcher.h.

References Matcher::create().

00321     {
00322       M_match_request_list->M_conditions.insert(Matcher::create(param, anyglobalchannel_mt, true));
00323       return *this;
00324     }

MatchRequest& MatchRequest::anylocalchannel ( int  param  )  [inline]

Request a match if parameter param contains any local channel name.

Definition at line 326 of file Matcher.h.

References Matcher::create().

00327     {
00328       M_match_request_list->M_conditions.insert(Matcher::create(param, anylocalchannel_mt, true));
00329       return *this;
00330     }

MatchRequest& MatchRequest::wildcard ( std::string const &  arg,
int  param,
bool  single_param = true 
) [inline]

Request a match if parameter param (and on if single_param is false) matches mask arg.

Definition at line 332 of file Matcher.h.

References Matcher::create().

00333     {
00334       M_match_request_list->M_conditions.insert(Matcher::create(param, wildcard_mt, arg, single_param));
00335       return *this;
00336     }

MatchRequest& MatchRequest::regexp ( std::string const &  arg,
int  param,
bool  single_param = true 
) [inline]

Request a match if parameter param (and on if single_param is false) matches regular expression arg.

Definition at line 338 of file Matcher.h.

References Matcher::create().

Referenced by ServerSession::new_message_received().

00339     {
00340       M_match_request_list->M_conditions.insert(Matcher::create(param, regexp_mt, arg, single_param));
00341       return *this;
00342     }

MatchRequest& MatchRequest::exactmatch ( std::string const &  arg,
int  param,
bool  single_param = true 
) [inline]

Request a match if parameter param (and on if single_param is false) matches the string arg exactly.

Definition at line 344 of file Matcher.h.

References Matcher::create().

00345     {
00346       M_match_request_list->M_conditions.insert(Matcher::create(param, exactmatch_mt, arg, single_param));
00347       return *this;
00348     }

bool MatchRequest::is_match ( ServerMessageIn const &  msg  )  const [inline]

Returns true if all match conditions are fullfilled.

Definition at line 350 of file Matcher.h.

Referenced by ServerSession::new_message_received().

00350 { return M_match_request_list->is_match(msg); }

MatchRequestList const& MatchRequest::match_request_list ( void   )  const [inline]

For debugging purposes. Returns the internal MatchRequestList.

Definition at line 353 of file Matcher.h.

Referenced by operator<<().

00353 { return *M_match_request_list; }


Member Data Documentation

Shared pointer to the match request list.

Definition at line 264 of file Matcher.h.


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

Copyright © 2005-2007 Carlo Wood.  All rights reserved.