#ifndef JSDataView_h
#define JSDataView_h
#include "DataView.h"
#include "JSArrayBufferView.h"
namespace JSC {
class JSDataView : public JSArrayBufferView {
public:
typedef JSArrayBufferView Base;
static const unsigned elementSize = 1;
protected:
JSDataView(VM&, ConstructionContext&, ArrayBuffer*);
public:
static JSDataView* create(
ExecState*, Structure*, PassRefPtr<ArrayBuffer>, unsigned byteOffset,
unsigned byteLength);
static JSDataView* createUninitialized(ExecState*, Structure*, unsigned length);
static JSDataView* create(ExecState*, Structure*, unsigned length);
bool set(ExecState*, unsigned, JSObject*, unsigned, unsigned length);
bool setIndex(ExecState*, unsigned, JSValue);
ArrayBuffer* buffer() const { return m_buffer; }
PassRefPtr<DataView> typedImpl();
static const TypedArrayType TypedArrayStorageType = TypeDataView;
protected:
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, const PropertyDescriptor&, bool shouldThrow);
static bool deleteProperty(JSCell*, ExecState*, PropertyName);
static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static ArrayBuffer* slowDownAndWasteMemory(JSArrayBufferView*);
static PassRefPtr<ArrayBufferView> getTypedArrayImpl(JSArrayBufferView*);
public:
static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype);
DECLARE_EXPORT_INFO;
private:
ArrayBuffer* m_buffer;
};
}
#endif // JSDataView_h