You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdelibs/tdecore/tdestringmatcher.h

61 lines
1.2 KiB
C++

#ifndef TDESTRINGMATCHER_H
#define TDESTRINGMATCHER_H
#include "tdelibs_export.h"
#include <tqstring.h>
#include <tqptrlist.h>
#include <tqobject.h>
#define TSMTRACE kdDebug() << "<TSMTRACE> "
#define TSMSIGNALS
/**
*
* Generic string matcher class.
*/
class TDECORE_EXPORT TDEStringMatcher : public TQObject
{
Q_OBJECT
public:
TDEStringMatcher();
~TDEStringMatcher();
/**
Use @param newPatternString to generate @property patternList. Refer to
file README.tdestringmatcher for more information on how the input
string should be formatted.
*/
bool generatePatternList( TQString newPatternString );
/**
Return pattern string from which @property patternList was created.
String is stored in @property TDEStringMatcherPrivate::patternString.
*/
TQString getPatternString();
/**
Methods that determine whether or not @param stringToMatch match
any/all of the TQRegExp objects contained in @property patternList.
*/
bool matchAny( const TQString& stringToMatch );
bool matchAll( const TQString& stringToMatch );
signals:
void patternsChanged();
protected:
TQPtrList<TQRegExp> patternList;
private:
class TDEStringMatcherPrivate;
TDEStringMatcherPrivate *p;
};
#endif