#ifndef StringObject_h
#define StringObject_h
#include "JSWrapperObject.h"
#include "JSString.h"
namespace JSC {
class StringObject : public JSWrapperObject {
public:
StringObject(ExecState*, NonNullPassRefPtr<Structure>);
StringObject(ExecState*, NonNullPassRefPtr<Structure>, const UString&);
static StringObject* create(ExecState*, JSString*);
virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
virtual void put(ExecState* exec, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
virtual const ClassInfo* classInfo() const { return &info; }
static const JS_EXPORTDATA ClassInfo info;
JSString* internalValue() const { return asString(JSWrapperObject::internalValue());}
static PassRefPtr<Structure> createStructure(JSValue prototype)
{
return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
}
protected:
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSWrapperObject::StructureFlags;
StringObject(NonNullPassRefPtr<Structure>, JSString*);
};
StringObject* asStringObject(JSValue);
inline StringObject* asStringObject(JSValue value)
{
ASSERT(asObject(value)->inherits(&StringObject::info));
return static_cast<StringObject*>(asObject(value));
}
}
#endif // StringObject_h