Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

Commit 13ff8dc

Browse files
committed
Update README.md
1 parent ae3e6a0 commit 13ff8dc

File tree

1 file changed

+30
-22
lines changed

1 file changed

+30
-22
lines changed

README.md

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# node-arraybuffer
2-
node-v0.12.0 > v8::ArrayBuffer handler
1+
NodeJS c++ ArrayBuffer handler
32

43
## Install
54

@@ -23,41 +22,50 @@ And add #include header in source code
2322
#include <ArrayBuffer.h>
2423
```
2524

26-
## Static Public Member Functions
25+
## NodeJS version < 12
2726

2827
```
29-
ArrayBuffer* New(v8::Isolate *isolate = 0, void *ptr = 0, size_t length = 0, bool release = false)
30-
ArrayBuffer* New(v8::Isolate *isolate, const char *ptr, int length = -1, bool release = false)
31-
ArrayBuffer* New(v8::Isolate *isolate, const v8::Local<v8::ArrayBuffer> &arrayBuffer)
32-
ArrayBuffer* New(v8::Isolate *isolate, const v8::Local<v8::Value> &arg)
28+
static ArrayBuffer* New(const char *str = 0)
29+
static ArrayBuffer* New(const char *str, size_t length)
30+
static ArrayBuffer* New(const std::string &data)
31+
static ArrayBuffer* New(const v8::Local<v8::Object> &arrayBuffer)
32+
static ArrayBuffer* New(const v8::Local<v8::Value> &arg)
33+
34+
v8::Local<v8::Object> ToArrayBuffer() const
35+
v8::Local<v8::String> ToString() const
36+
37+
const char *ToUtf8() const
38+
void *Data() const
39+
size_t Length() const
40+
size_t ByteLength() const
3341
```
3442

35-
## Static Template Public Member Functions
43+
## NodeJS version >= 12
3644

3745
```
38-
ArrayBuffer* New(v8::Isolate *isolate, const T &content)
39-
ArrayBuffer* New(v8::Isolate *isolate, const T &content, void *ptr, size_t length = 0)
40-
ArrayBuffer* New(v8::Isolate *isolate, const T &content, const char *ptr, int length = -1)
41-
```
46+
static ArrayBuffer* New(const char *str = 0)
47+
static ArrayBuffer* New(const char *str, size_t length)
48+
static ArrayBuffer* New(const std::string &data)
49+
static ArrayBuffer* New(const v8::Local<v8::ArrayBuffer> &arrayBuffer)
50+
static ArrayBuffer* New(const v8::Local<v8::Value> &arg)
4251
43-
## Public Member Functions
52+
static ArrayBuffer* New(v8::Isolate *isolate, const char *str = 0)
53+
static ArrayBuffer* New(v8::Isolate *isolate, const char *str, size_t length)
54+
static ArrayBuffer* New(v8::Isolate *isolate, const std::string &data)
55+
static ArrayBuffer* New(v8::Isolate *isolate, const v8::Local<v8::ArrayBuffer> &arrayBuffer)
56+
static ArrayBuffer* New(v8::Isolate *isolate, const v8::Local<v8::Value> &arg)
57+
58+
v8::Local<v8::ArrayBuffer> ToArrayBuffer(v8::Isolate *isolate = 0) const
59+
v8::Local<v8::String> ToStringv8::Isolate *isolate = 0() const
4460
45-
```
46-
v8::Local<v8::ArrayBuffer> ToArrayBuffer() const
47-
v8::Local<v8::String> ToString() const
4861
const char *ToUtf8() const
4962
void *Data() const
5063
size_t Length() const
5164
size_t ByteLength() const
5265
```
5366

54-
## Public Template Member Functions
55-
56-
```
57-
const T &Unwrap() const
58-
```
59-
6067
## Example
6168

6269
[sample.cc](https://github.com/vmolsa/node-arraybuffer-example/blob/master/sample.cc)
70+
6371
[sample.js](https://github.com/vmolsa/node-arraybuffer-example/blob/master/sample.js)

0 commit comments

Comments
 (0)