source:
webkit/trunk/JavaScriptCore/kjs/RegExpObject.h@
36270
Last change on this file since 36270 was 36263, checked in by [email protected], 17 years ago | |
---|---|
2008-09-07 Cameron Zwarich <[email protected]>
|
|
|
|
File size: 2.4 KB |
Line | |
---|---|
1 | /* |
2 | * Copyright (C) 1999-2000 Harri Porten ([email protected]) |
3 | * Copyright (C) 2003, 2007, 2008 Apple Inc. All Rights Reserved. |
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 RegExpObject_h |
22 | #define RegExpObject_h |
23 | |
24 | #include "JSObject.h" |
25 | #include "regexp.h" |
26 | |
27 | namespace JSC { |
28 | |
29 | class RegExpPrototype; |
30 | |
31 | class RegExpObject : public JSObject { |
32 | public: |
33 | enum { Global, IgnoreCase, Multiline, Source, LastIndex }; |
34 | |
35 | RegExpObject(RegExpPrototype*, PassRefPtr<RegExp>); |
36 | virtual ~RegExpObject(); |
37 | |
38 | void setRegExp(PassRefPtr<RegExp> r) { d->regExp = r; } |
39 | RegExp* regExp() const { return d->regExp.get(); } |
40 | |
41 | JSValue* test(ExecState*, const ArgList&); |
42 | JSValue* exec(ExecState*, const ArgList&); |
43 | |
44 | bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); |
45 | JSValue* getValueProperty(ExecState*, int token) const; |
46 | void put(ExecState*, const Identifier& propertyName, JSValue*, PutPropertySlot&); |
47 | void putValueProperty(ExecState*, int token, JSValue*); |
48 | |
49 | virtual const ClassInfo* classInfo() const { return &info; } |
50 | static const ClassInfo info; |
51 | |
52 | void setLastIndex(double lastIndex) { d->lastIndex = lastIndex; } |
53 | |
54 | private: |
55 | bool match(ExecState*, const ArgList&); |
56 | |
57 | virtual CallType getCallData(CallData&); |
58 | |
59 | struct RegExpObjectData { |
60 | RegExpObjectData(PassRefPtr<RegExp> regExp_, double lastIndex_) |
61 | : regExp(regExp_) |
62 | , lastIndex(lastIndex_) |
63 | { |
64 | } |
65 | |
66 | RefPtr<RegExp> regExp; |
67 | double lastIndex; |
68 | }; |
69 | |
70 | OwnPtr<RegExpObjectData> d; |
71 | }; |
72 | |
73 | } // namespace JSC |
74 | |
75 | #endif // RegExpObject_h |
Note:
See TracBrowser
for help on using the repository browser.