@@ -8,9 +8,11 @@ return_to:
88 " API Documentation Index " : /api/
99sections :
1010 " #containsNul " : " #containsNul"
11+ " #dispose " : " #dispose"
1112 " #grow " : " #grow"
1213 " #isBinary " : " #isBinary"
1314 " #set " : " #set"
15+ " #setString " : " #setString"
1416 " Instance Variables " : " #ivars"
1517---
1618
@@ -24,12 +26,16 @@ var result = buf.containsNul();
2426| --- | --- |
2527| Number | 1 if buffer contains a NUL byte |
2628
27- ## <a name =" grow " ></a ><span >Buf#</span >grow <span class =" tags " ><span class =" async " >Async </span ><span class =" experimental " >Experimental</span ></span >
29+ ## <a name =" dispose " ></a ><span >Buf#</span >dispose <span class =" tags " ><span class =" sync " >Sync </span ><span class =" experimental " >Experimental</span ></span >
2830
2931``` js
30- buf .grow (target_size).then (function (result ) {
31- // Use result
32- });
32+ buf .dispose ();
33+ ```
34+ 35+ ## <a name =" grow " ></a ><span >Buf#</span >grow <span class =" tags " ><span class =" sync " >Sync</span ><span class =" experimental " >Experimental</span ></span >
36+ 37+ ``` js
38+ var result = buf .grow (target_size);
3339```
3440
3541| Parameters | Type |
@@ -50,12 +56,10 @@ var result = buf.isBinary();
5056| --- | --- |
5157| Number | 1 if buffer looks like non-text data |
5258
53- ## <a name =" set " ></a ><span >Buf#</span >set <span class =" tags " ><span class =" async " >Async </span ><span class =" experimental " >Experimental</span ></span >
59+ ## <a name =" set " ></a ><span >Buf#</span >set <span class =" tags " ><span class =" sync " >Sync </span ><span class =" experimental " >Experimental</span ></span >
5460
5561``` js
56- buf .set (data, datalen).then (function (result ) {
57- // Use result
58- });
62+ var result = buf .set (data, datalen);
5963```
6064
6165| Parameters | Type |
@@ -67,6 +71,18 @@ buf.set(data, datalen).then(function(result) {
6771| --- | --- |
6872| Number | 0 on success, -1 on allocation failure |
6973
74+ ## <a name =" setString " ></a ><span >Buf#</span >setString <span class =" tags " ><span class =" sync " >Sync</span ></span >
75+ 76+ ``` js
77+ buf .setString (The);
78+ ```
79+ 80+ Sets the content of a GitBuf to a string.
81+ 82+ | Parameters | Type |
83+ | --- | --- | --- |
84+ | The | string | utf8 value to set in the buffer. The string will be null terminated. |
85+ 7086## <a name =" ivars " ></a >Instance Variables
7187
7288| Variable | Type | Description |
0 commit comments