Changeset 798 in webkit for trunk/JavaScriptCore/kjs/regexp.h


Ignore:
Timestamp:
Mar 21, 2002, 4:31:57 PM (23 years ago)
Author:
mjs
Message:

Merged changes from LABYRINTH_KDE_3_MERGE branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/regexp.h

    r6 r798  
     1// -*- c-basic-offset: 2 -*-
    12/*
    23 *  This file is part of the KDE libraries
     
    1617 *  License along with this library; if not, write to the Free Software
    1718 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     19 *
     20 *  $Id$
    1821 */
    1922
     
    2730#ifdef HAVE_PCREPOSIX
    2831#include <pcreposix.h>
     32#include <pcre.h>
    2933#else  // POSIX regex - not so good...
    3034extern "C" { // bug with some libc5 distributions
     
    3943  class RegExp {
    4044  public:
    41     enum { None, Global, IgnoreCase, Multiline };
     45    enum { None = 0, Global = 1, IgnoreCase = 2, Multiline = 4 };
    4246    RegExp(const UString &p, int f = None);
    4347    ~RegExp();
    44     UString match(const UString &s, int i = -1, int *pos = 0L);
    45     bool test(const UString &s, int i = -1);
     48    UString match(const UString &s, int i = -1, int *pos = 0L, int **ovector = 0L);
     49    // test is unused. The JS spec says that RegExp.test should use
     50    // RegExp.exec, so it has to store $1 etc.
     51    // bool test(const UString &s, int i = -1);
     52    uint subPatterns() const { return nrSubPatterns; }
    4653  private:
    4754    const UString &pattern;
    4855    int flags;
     56
     57#ifndef HAVE_PCREPOSIX
    4958    regex_t preg;
     59#else
     60    pcre *pcregex;
     61#endif
     62    uint nrSubPatterns;
    5063
    5164    RegExp();
Note: See TracChangeset for help on using the changeset viewer.