• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kjs
 

kjs

  • kjs
regexp_object.h
1 // -*- c-basic-offset: 2 -*-
2 /*
3  * This file is part of the KDE libraries
4  * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  */
21 
22 #ifndef _REGEXP_OBJECT_H_
23 #define _REGEXP_OBJECT_H_
24 
25 #include "internal.h"
26 #include "function_object.h"
27 #include "regexp.h"
28 
29 namespace KJS {
30  class ExecState;
31  class RegExpPrototypeImp : public ObjectImp {
32  public:
33  RegExpPrototypeImp(ExecState *exec,
34  ObjectPrototypeImp *objProto,
35  FunctionPrototypeImp *funcProto);
36  virtual const ClassInfo *classInfo() const { return &info; }
37  static const ClassInfo info;
38  };
39 
40  class RegExpProtoFuncImp : public InternalFunctionImp {
41  public:
42  RegExpProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len,
43  const Identifier &_ident);
44 
45  virtual bool implementsCall() const;
46  virtual Value call(ExecState *exec, Object &thisObj, const List &args);
47 
48  enum { Exec, Test, ToString, Compile };
49  private:
50  int id;
51  };
52 
53  class RegExpImp : public ObjectImp {
54  public:
55  RegExpImp(RegExpPrototypeImp *regexpProto);
56  ~RegExpImp();
57  void setRegExp(RegExp *r);
58  RegExp* regExp() { return reg; }
59 
60  virtual const ClassInfo *classInfo() const { return &info; }
61  static const ClassInfo info;
62  private:
63  RegExp *reg;
64  };
65 
66  class RegExpObjectImp : public InternalFunctionImp {
67  public:
68  RegExpObjectImp(ExecState *exec,
69  FunctionPrototypeImp *funcProto,
70  RegExpPrototypeImp *regProto);
71  virtual ~RegExpObjectImp();
72  virtual bool implementsConstruct() const;
73  virtual Object construct(ExecState *exec, const List &args);
74  virtual bool implementsCall() const;
75  virtual Value call(ExecState *exec, Object &thisObj, const List &args);
76 
77  Value get(ExecState *exec, const Identifier &p) const;
78  bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
79  int ** registerRegexp( const RegExp* re, const UString& s );
80  void setSubPatterns(int num) { lastNrSubPatterns = num; }
81  Object arrayOfMatches(ExecState *exec, const UString &result) const;
82 
83  /*
84  Attempts to create a new regular expression engine for the string p
85  and the flags stored in flagsInput. If this succeeds, it returns the
86  engine. If not, it returns 0, and raises an exception in exec
87  */
88  static RegExp* makeEngine(ExecState *exec, const UString &p, const Value &flagsInput);
89  private:
90  UString lastString;
91  int *lastOvector;
92  unsigned int lastNrSubPatterns;
93  };
94 
95 } // namespace
96 
97 #endif
KJS
Definition: array_instance.h:28

kjs

Skip menu "kjs"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kjs

Skip menu "kjs"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kjs by doxygen 1.8.13
This website is maintained by Timothy Pearson.