00001 /*************************************************************************** 00002 * Copyright (C) 2002 by Yann Hodique * 00003 * Yann.Hodique@lifl.fr * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 ***************************************************************************/ 00010 00011 #ifndef _MTPREGEXP_H_ 00012 #define _MTPREGEXP_H_ 00013 00014 #include <qstring.h> 00015 #include <qregexp.h> 00016 00017 #include "MtpContext.h" 00018 00023 class MtpRegExp { 00024 00025 public: 00026 MtpRegExp(const QString & = "", MtpContext * ctxt = 0); 00027 ~MtpRegExp(); 00028 00029 bool exactMatch(const QString &); 00030 QString cap(int i); 00031 int search(const QString&,int&) const; 00032 int matchedLength() const; 00033 00034 private: 00035 QRegExp reg; 00036 QString pattern; 00037 MtpContext * m_context; 00038 }; 00039 00040 #endif