aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/Buffer.cpp
blob: 28b49791fc6fb03b031525c595b84dc5c1f5b17c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// ----- THIS IS NOT WEBCORE ----
// It reuses the namespace.
// ----- THIS IS NOT WEBCORE ----

// Node.js buffer

#include "root.h"

#include "Buffer.h"
#include "JavaScriptCore/Uint8Array.h"

namespace WebCore {

Ref<Buffer> Buffer::create(JSC::JSGlobalObject* globalObject, JSC::JSUint8Array* array, size_t byteOffset, size_t length)
{
    return adoptRef(*new Buffer(globalObject, array, byteOffset, length));
}
Ref<Buffer> Buffer::create(JSC::JSGlobalObject* globalObject, JSC::JSUint8Array* array)
{
    return create(globalObject, array, 0, array->byteLength());
}

int32_t static write(WTF::StringView view, size_t offset, size_t length, BufferEncodingType encodingType)
{
}

Buffer::~Buffer()
{
}

Ref<Buffer> Buffer::createEmpty(JSC::JSGlobalObject* globalObject)
{
    return adoptRef(*new Buffer(globalObject, nullptr, 0, 0));
}
Ref<Buffer> Buffer::create(JSC::JSGlobalObject* globalObject, UChar* ptr, size_t len, BufferEncodingType encoding)
{
}
Ref<Buffer> Buffer::create(JSC::JSGlobalObject* globalObject, LChar* ptr, size_t len, BufferEncodingType encoding)
{
}

Ref<Buffer> Buffer::create(JSC::JSGlobalObject* globalObject, WTF::StringView& str, BufferEncodingType encoding)
{
    if (str.is8Bit()) {
    }
}
Ref<Buffer> Buffer::create(JSC::JSGlobalObject* globalObject, WTF::String& str, BufferEncodingType encoding)
{
}

}