Difference between revisions of "Data:getString"

m
m
 
Line 5: Line 5:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
data = Data:getString( )
+
data = Data:getString( offset, size )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
None.
+
{{New feature|12.0|
 +
{{param|number|offset (0)|Optional byte offset into the Data's memory to copy from.}}
 +
{{param|number|size (Data:getSize())|Optionally limit the copied string to the specified number of bytes.}}
 +
|120}}
 
=== Returns ===
 
=== Returns ===
 
{{param|string|data|The raw data.}}
 
{{param|string|data|The raw data.}}
== Notes ==
 
The returned string count towards of LuaJIT 1GB/2GB memory limit, in some platforms.
 
 
== See Also ==
 
== See Also ==
 
* [[parent::Data]]
 
* [[parent::Data]]

Latest revision as of 16:12, 13 April 2024

Available since LÖVE 0.9.0
This function is not supported in earlier versions.


Gets the full Data as a string.

Function

Synopsis

data = Data:getString( offset, size )

Arguments

Available since LÖVE 12.0
number offset (0)
Optional byte offset into the Data's memory to copy from.
number size (Data:getSize())
Optionally limit the copied string to the specified number of bytes.

Returns

string data
The raw data.

See Also

Other Languages