summaryrefslogtreecommitdiff
path: root/xmake/core/base/bytes.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-03-26 23:59:26 +0800
committerruki <[email protected]>2026-03-26 23:59:26 +0800
commitc08081788e880f32f1835eab49aae5806cb19721 (patch)
tree6444775397b86b47b75c337cd74f3a419ed2bdc1 /xmake/core/base/bytes.lua
parent6dd2023c43ab4fc46d9bce7599e6875e4ff33957 (diff)
improve more 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