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

kjs

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

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.9.4
This website is maintained by Timothy Pearson.