diff options
| author | ruki <[email protected]> | 2026-03-28 15:46:11 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-28 15:46:11 +0800 |
| commit | 1df5ac2921a800c766fc64d4db6a85975c171e32 (patch) | |
| tree | feb30c468c4e89a5c8338b4a90786d97ceed481e /xmake/core/base/bytes.lua | |
| parent | c86b161f6b27040289c75f3cafe7a863dea737bc (diff) | |
| parent | c08081788e880f32f1835eab49aae5806cb19721 (diff) | |
Merge pull request #7424 from xmake-io/comments
improve comments
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 |
