1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
//
// $Id: qaregexp.hpp,v 1.9 2000/06/12 10:54:18 amos Exp $
//
// Definition of QaRegExp class
//
// Jan Borsodi <amos@abn.hibu.no>
// Created on: <14-Jul-1999 19:14:57 amos>
//
#ifndef QAREGEXP_HPP
#define QAREGEXP_HPP
#include "qaregexpmatch.hpp"
#include <qstring.h>
#include <qstringlist.h>
#include <regex.h>
class QaRegExp
{
public:
QaRegExp( const QString &r, bool c = true, bool newline = true );
QaRegExp( const QaRegExp &r );
virtual ~QaRegExp();
bool caseSensitive() const;
bool handleNewline() const;
void setCaseSensitive( bool s );
void setHandleNewline( bool h );
bool match( const QString &s );
bool match( const QString &s, int sub );
int matchMultiple( const QString &s );
int matchMultiple( const QString &s, int sub );
QString matchString();
QString matchString( int sub );
QStringList matchStrings();
int matchBeginning() const;
int matchBeginning( int sub ) const;
int matchEnd() const;
int matchEnd( int sub ) const;
const QaRegExpMatch &matches() const;
int split( const QString &s );
int subCount() const;
void setExpression( const QString &r );
QaRegExp &operator =( const QaRegExp &r );
private:
void compileRegExp();
void setSubReg( bool b );
private:
QString RegString;
QString String;
int Flags;
bool Case;
bool NewLine;
bool Subs;
bool Alloced;
regex_t RegComp;
int NumSub;
QaRegExpMatch Matches;
};
#endif // QAREGEXP_HPP
|