mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-05 13:08:58 +00:00
[Lua] manipulate byte array as string (#6624)
* [Lua] manipulate byte array as string Sometimes it would be more effective than reading byte by byte * change according to the review * update
This commit is contained in:
@@ -62,6 +62,9 @@ function Monster_mt:Inventory(j)
|
||||
end
|
||||
return 0
|
||||
end
|
||||
function Monster_mt:InventoryAsString(start, stop)
|
||||
return self.view:VectorAsString(14, start, stop)
|
||||
end
|
||||
function Monster_mt:InventoryLength()
|
||||
local o = self.view:Offset(14)
|
||||
if o ~= 0 then
|
||||
@@ -160,6 +163,9 @@ function Monster_mt:Testnestedflatbuffer(j)
|
||||
end
|
||||
return 0
|
||||
end
|
||||
function Monster_mt:TestnestedflatbufferAsString(start, stop)
|
||||
return self.view:VectorAsString(30, start, stop)
|
||||
end
|
||||
function Monster_mt:TestnestedflatbufferLength()
|
||||
local o = self.view:Offset(30)
|
||||
if o ~= 0 then
|
||||
@@ -315,6 +321,9 @@ function Monster_mt:Flex(j)
|
||||
end
|
||||
return 0
|
||||
end
|
||||
function Monster_mt:FlexAsString(start, stop)
|
||||
return self.view:VectorAsString(64, start, stop)
|
||||
end
|
||||
function Monster_mt:FlexLength()
|
||||
local o = self.view:Offset(64)
|
||||
if o ~= 0 then
|
||||
@@ -518,6 +527,9 @@ function Monster_mt:VectorOfEnums(j)
|
||||
end
|
||||
return 0
|
||||
end
|
||||
function Monster_mt:VectorOfEnumsAsString(start, stop)
|
||||
return self.view:VectorAsString(98, start, stop)
|
||||
end
|
||||
function Monster_mt:VectorOfEnumsLength()
|
||||
local o = self.view:Offset(98)
|
||||
if o ~= 0 then
|
||||
@@ -540,6 +552,9 @@ function Monster_mt:Testrequirednestedflatbuffer(j)
|
||||
end
|
||||
return 0
|
||||
end
|
||||
function Monster_mt:TestrequirednestedflatbufferAsString(start, stop)
|
||||
return self.view:VectorAsString(102, start, stop)
|
||||
end
|
||||
function Monster_mt:TestrequirednestedflatbufferLength()
|
||||
local o = self.view:Offset(102)
|
||||
if o ~= 0 then
|
||||
|
||||
Reference in New Issue
Block a user