diff options
Diffstat (limited to 'xmake/core/base/bytes.lua')
| -rw-r--r-- | xmake/core/base/bytes.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xmake/core/base/bytes.lua b/xmake/core/base/bytes.lua index f249096bf..35ccf8998 100644 --- a/xmake/core/base/bytes.lua +++ b/xmake/core/base/bytes.lua @@ -583,12 +583,20 @@ function _instance:__gc() end end --- new an bytes instance +-- create a new bytes instance +-- +-- @param ... the data (string, number/size, cdata + size, or another bytes) +-- @return the bytes instance +-- function bytes.new(...) return _instance.new(...) end --- is instance of bytes? +-- is the data an instance of bytes? +-- +-- @param data the data to check +-- @return true if it is a bytes instance +-- function bytes.instance_of(data) if type(data) == "table" and data.cdata and data.size then return true |
