regexp.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _KJS_REGEXP_H_
00024 #define _KJS_REGEXP_H_
00025
00026 #include <sys/types.h>
00027
00028 #include "config.h"
00029
00030 #ifdef HAVE_PCREPOSIX
00031 #include <pcreposix.h>
00032 #include <pcre.h>
00033 #else // POSIX regex - not so good...
00034 extern "C" {
00035 #include <regex.h>
00036 }
00037 #endif //HAVE_PCREPOSIX
00038
00039 #include "ustring.h"
00040
00041 namespace KJS {
00042
00043 class RegExp {
00044 public:
00045 enum { None = 0, Global = 1, IgnoreCase = 2, Multiline = 4 };
00046 RegExp(const UString &p, int f = None);
00047 ~RegExp();
00048 int flags() const { return flgs; }
00049 UString match(const UString &s, int i, int *pos = 0, int **ovector = 0);
00050
00051
00052
00053 uint subPatterns() const { return nrSubPatterns; }
00054 private:
00055 const UString &pattern;
00056 int flgs;
00057 bool m_notEmpty;
00058
00059 #ifndef HAVE_PCREPOSIX
00060 regex_t preg;
00061 #else
00062 pcre *pcregex;
00063 #endif
00064 uint nrSubPatterns;
00065
00066 RegExp();
00067 };
00068
00069 };
00070
00071 #endif
This file is part of the documentation for kdelibs Version 3.1.0.