awtk/docs/fscript_wbuffer.md
2021-01-12 14:29:47 +08:00

1001 B

写缓冲扩展函数

1.wbuffer_create

2.wbuffer_attach

3.wbuffer_skip

4.wbuffer_rewind

5.wbuffer_write_uint8

6.wbuffer_write_uint16

7.wbuffer_write_uint32

8.wbuffer_write_uint64

9.wbuffer_write_int8

10.wbuffer_write_int16

11.wbuffer_write_int32

12.wbuffer_write_int64

13.wbuffer_write_float

14.wbuffer_write_double

15.wbuffer_write_string

16.wbuffer_write_binary

17.wbuffer_get_data

18.wbuffer_get_cursor

19.wbuffer_get_capacity

更多示例

a=wbuffer_create()
wbuffer_write_int8(a, -10) 
assert(wbuffer_get_cursor(a)==1)
wbuffer_write_int16(a, -1122) 
assert(wbuffer_get_cursor(a)==3)
wbuffer_write_int32(a, -11223344) 
assert(wbuffer_get_cursor(a)==7)
wbuffer_write_int64(a, -1122334455667788)
assert(wbuffer_get_cursor(a)==15)

wbuffer_write_string(a, "hello")
assert(wbuffer_get_cursor(a)==21)

wbuffer_write_binary(a, "wolrd", 6)
assert(wbuffer_get_cursor(a)==27)