kmail

KMSearchRuleString Class Reference

This class represents a search to be performed against a string. More...

#include <kmsearchpattern.h>

Inheritance diagram for KMSearchRuleString:

List of all members.


Public Member Functions

virtual bool isEmpty () const
 KMSearchRuleString (const KMSearchRuleString &other)
 KMSearchRuleString (const QCString &field=0, Function function=FuncContains, const QString &contents=QString::null)
virtual bool matches (const DwString &str, KMMessage &msg, const DwBoyerMoore *headerField=0, int headerLen=-1) const
virtual bool matches (const KMMessage *msg) const
bool matchesInternal (const QString &msgContents) const
const KMSearchRuleStringoperator= (const KMSearchRuleString &other)
virtual bool requiresBody () const
virtual ~KMSearchRuleString ()

Detailed Description

This class represents a search to be performed against a string.

The string can be either a message header, or a pseudo header, such as <body> This class represents a search pattern rule operating on a string.

Definition at line 159 of file kmsearchpattern.h.


Constructor & Destructor Documentation

KMSearchRuleString::KMSearchRuleString ( const QCString field = 0,
Function  function = FuncContains,
const QString contents = QString::null 
)

Definition at line 197 of file kmsearchpattern.cpp.

KMSearchRuleString::KMSearchRuleString ( const KMSearchRuleString other  ) 

Definition at line 207 of file kmsearchpattern.cpp.

KMSearchRuleString::~KMSearchRuleString (  )  [virtual]

Definition at line 231 of file kmsearchpattern.cpp.


Member Function Documentation

bool KMSearchRuleString::isEmpty (  )  const [virtual]

Determine whether the rule is worth considering.

It isn't if either the field is not set or the contents is empty. KFilter should make sure that it's rule list contains only non-empty rules, as matches doesn't check this.

Implements KMSearchRule.

Definition at line 237 of file kmsearchpattern.cpp.

bool KMSearchRuleString::matches ( const DwString &  str,
KMMessage msg,
const DwBoyerMoore *  headerField = 0,
int  headerLen = -1 
) const [virtual]

Optimized version tries to match the rule against the given DwString.

Returns:
TRUE if the rule matched, FALSE otherwise.

Reimplemented from KMSearchRule.

Definition at line 249 of file kmsearchpattern.cpp.

bool KMSearchRuleString::matches ( const KMMessage msg  )  const [virtual]

Tries to match the rule against the given KMMessage.

Returns:
TRUE if the rule matched, FALSE otherwise. Must be implemented by subclasses.

Implements KMSearchRule.

Definition at line 323 of file kmsearchpattern.cpp.

bool KMSearchRuleString::matchesInternal ( const QString msgContents  )  const

Helper for the main matches() method.

Does the actual comparing.

Definition at line 397 of file kmsearchpattern.cpp.

const KMSearchRuleString & KMSearchRuleString::operator= ( const KMSearchRuleString other  ) 

Definition at line 215 of file kmsearchpattern.cpp.

bool KMSearchRuleString::requiresBody (  )  const [virtual]

Returns true if the rule depends on a complete message, otherwise returns false.

Reimplemented from KMSearchRule.

Definition at line 242 of file kmsearchpattern.cpp.


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