summaryrefslogtreecommitdiff
path: root/xmake/core/base/bytes.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-03-28 15:46:11 +0800
committerGitHub <[email protected]>2026-03-28 15:46:11 +0800
commit1df5ac2921a800c766fc64d4db6a85975c171e32 (patch)
treefeb30c468c4e89a5c8338b4a90786d97ceed481e /xmake/core/base/bytes.lua
parentc86b161f6b27040289c75f3cafe7a863dea737bc (diff)
parentc08081788e880f32f1835eab49aae5806cb19721 (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.lua12
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