RegExpConstructor.h [plain text]
#ifndef RegExpConstructor_h
#define RegExpConstructor_h
#include "InternalFunction.h"
#include <wtf/OwnPtr.h>
namespace JSC {
class RegExp;
class RegExpPrototype;
struct RegExpConstructorPrivate;
class RegExpConstructor : public InternalFunction {
public:
RegExpConstructor(ExecState*, PassRefPtr<Structure>, RegExpPrototype*);
static PassRefPtr<Structure> createStructure(JSValue prototype)
{
return Structure::create(prototype, TypeInfo(ObjectType, ImplementsHasInstance));
}
virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
static const ClassInfo info;
void performMatch(RegExp*, const UString&, int startOffset, int& position, int& length, int** ovector = 0);
JSObject* arrayOfMatches(ExecState*) const;
void setInput(const UString&);
const UString& input() const;
void setMultiline(bool);
bool multiline() const;
JSValue getBackref(ExecState*, unsigned) const;
JSValue getLastParen(ExecState*) const;
JSValue getLeftContext(ExecState*) const;
JSValue getRightContext(ExecState*) const;
private:
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual const ClassInfo* classInfo() const { return &info; }
OwnPtr<RegExpConstructorPrivate> d;
};
RegExpConstructor* asRegExpConstructor(JSValue);
JSObject* constructRegExp(ExecState*, const ArgList&);
inline RegExpConstructor* asRegExpConstructor(JSValue value)
{
ASSERT(asObject(value)->inherits(&RegExpConstructor::info));
return static_cast<RegExpConstructor*>(asObject(value));
}
}
#endif // RegExpConstructor_h