ircproxy  The Ultimate Cyborg

Matcher_matchcomp Class Reference

#include <Matcher.h>

Inheritance diagram for Matcher_matchcomp:

Matcher

List of all members.


Detailed Description

Wildcard (* and ?) matcher.

Definition at line 134 of file Matcher.h.


Public Member Functions

 Matcher_matchcomp (int param, std::string const &arg, bool single_param)
 Construct a Matcher_matchcomp instance that matches parameter param (and on if single_param is false) against mask arg.
 ~Matcher_matchcomp ()
 Destructor.
virtual void print_type_on (std::ostream &os) const
 For debugging purposes. Write the class name to os.
virtual void print_on (std::ostream &os) const
 For debugging purposes. Write the compiled mask to os.
virtual int sort_value (void)
 Implementation of pure virtual function Matcher::sort_value().

Protected Member Functions

virtual bool match_impl (ServerSession const &, char const *start, size_t len)
 Implementation of pure virtual function Matcher::match_impl.

Private Attributes

char * M_cmask
 Compiled mask.
int M_minlen
 The minimum length of a string that can match.

Constructor & Destructor Documentation

Matcher_matchcomp::Matcher_matchcomp ( int  param,
std::string const &  arg,
bool  single_param 
) [inline]

Construct a Matcher_matchcomp instance that matches parameter param (and on if single_param is false) against mask arg.

Definition at line 141 of file Matcher.h.

References M_cmask, and M_minlen.

00141                                                                           :
00142         Matcher(param, single_param), M_cmask(new char[arg.size() + 1])
00143         { AllocTag(M_cmask, "Matcher_matchcomp::M_cmask"); matchcomp(M_cmask, &M_minlen, NULL, arg.c_str()); }
    //! Destructor.

Matcher_matchcomp::~Matcher_matchcomp (  )  [inline]

Destructor.

Definition at line 145 of file Matcher.h.

References M_cmask.

00145 { delete [] M_cmask; }


Member Function Documentation

virtual void Matcher_matchcomp::print_type_on ( std::ostream &  os  )  const [inline, virtual]

For debugging purposes. Write the class name to os.

Implements Matcher.

Definition at line 149 of file Matcher.h.

00149 { os << "Matcher_matchcomp"; }

virtual void Matcher_matchcomp::print_on ( std::ostream &  os  )  const [inline, virtual]

For debugging purposes. Write the compiled mask to os.

Reimplemented from Matcher.

Definition at line 151 of file Matcher.h.

References M_cmask, and M_minlen.

00152         { os << "cmask: \"" << M_cmask << "\", minlen: " << M_minlen; }

virtual bool Matcher_matchcomp::match_impl ( ServerSession const &  ,
char const *  start,
size_t  len 
) [inline, protected, virtual]

Implementation of pure virtual function Matcher::match_impl.

Implements Matcher.

Definition at line 158 of file Matcher.h.

References M_cmask, and M_minlen.

00159         { return len >= (size_t)M_minlen && matchexec(start, len, M_cmask, M_minlen) == 0; }

virtual int Matcher_matchcomp::sort_value ( void   )  [inline, virtual]

Implementation of pure virtual function Matcher::sort_value().

Implements Matcher.

Definition at line 163 of file Matcher.h.

00163 { return wildcard_mt; }


Member Data Documentation

char* Matcher_matchcomp::M_cmask [private]

Compiled mask.

Definition at line 136 of file Matcher.h.

Referenced by match_impl(), Matcher_matchcomp(), print_on(), and ~Matcher_matchcomp().

The minimum length of a string that can match.

Definition at line 137 of file Matcher.h.

Referenced by match_impl(), Matcher_matchcomp(), and print_on().


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

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