File: qaregexp.hpp

package info (click to toggle)
regexplorer 0.1.3-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 332 kB
  • ctags: 222
  • sloc: cpp: 1,166; perl: 99; makefile: 45; sh: 32
file content (58 lines) | stat: -rw-r--r-- 1,255 bytes parent folder | download
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
// 
// $Id: qaregexp.hpp,v 1.7 1999/08/16 00:49:44 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 );
    QaRegExp( const QaRegExp &r );
    virtual ~QaRegExp();

    bool caseSensitive() const;
    void setCaseSensitive( bool s );

    bool match( const QString &s, int sub = 0 );
    int matchMultiple( const QString &s, int sub = 0 );
    QString matchString( int sub = 0 );
    QStringList matchStrings();
    int matchBeginning( int sub = 0 ) const;
    int matchEnd( int sub = 0 ) const;
    const QaRegExpMatch &matches() const;
    void 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 Subs;
    bool Alloced;
    regex_t RegComp;
    int NumSub;
    QaRegExpMatch Matches;
};


#endif // QAREGEXP_HPP