Difference between revisions of "Buffer"

From GiderosMobile
(Created page with "__NOTOC__ <languages /> <!-- GIDEROSOBJ:Buffer --> '''<translate>Supported platforms</translate>:''' File:Platform android.pngFile:Platform ios.pngFile:Platform mac....")
 
(language stuff)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
 
 
<!-- GIDEROSOBJ:Buffer -->
 
<!-- GIDEROSOBJ:Buffer -->
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/>
+
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/>
'''<translate>Available since</translate>:''' Gideros 2020.2<br/>
+
'''Available since:''' Gideros 2020.2<br/>
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Object|Object]]<br/>
+
'''Inherits from:''' [[Object]]<br/>
  
=== <translate>Description</translate> ===
+
=== Description ===
 
The Buffer class acts as FIFO buffer with Gideros internal file system integration.
 
The Buffer class acts as FIFO buffer with Gideros internal file system integration.
At lua side, Buffers are created with a name, and data can be added or from them.
+
 
 +
At lua side, Buffers are created with a name, and data can be added or taken from them.
 +
 
 
Once created, buffer data can also be accessed by internal gideros functions that normally use files, such as textures or sounds. To do that pass '''|B|buffer.ext''' as the file name, where buffer.ext is that name of the buffer.
 
Once created, buffer data can also be accessed by internal gideros functions that normally use files, such as textures or sounds. To do that pass '''|B|buffer.ext''' as the file name, where buffer.ext is that name of the buffer.
  
 
{|-
 
{|-
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
=== <translate>Methods</translate> ===
+
=== Methods ===
[[Special:MyLanguage/Buffer.new|Buffer.new]] ''<translate>creates a new Buffer object</translate>''<br/>
+
[[Buffer.new]] ''creates a new Buffer object''<br/><!--GIDEROSMTD:Buffer.new(name) creates a new Buffer object-->
<!-- GIDEROSMTD:Buffer.new(name) creates a new Buffer object -->
+
[[Buffer:append]] ''adds data at the end of the buffer''<br/><!-- GIDEROSMTD:Buffer:append(data) adds data at the end of the buffer-->
[[Special:MyLanguage/Buffer:append|Buffer:append]] ''<translate>adds data at the end of the buffer</translate>''<br/>
+
[[Buffer:prepend]] ''adds data at the beginning of the buffer''<br/><!--GIDEROSMTD:Buffer:prepend(data) adds data at the beginning of the buffer-->
<!-- GIDEROSMTD:Buffer:append(data) adds data at the end of the buffer -->
+
[[Buffer:trim]] ''removes data from the start or the end of the buffer''<br/><!--GIDEROSMTD:Buffer:trim(amount) removes data from the start or the end of the buffer-->
[[Special:MyLanguage/Buffer:prepend|Buffer:prepend]] ''<translate>adds data at the beginning of the buffer</translate>''<br/>
+
[[Buffer:set]] ''sets data in the buffer''<br/><!--GIDEROSMTD:Buffer:set(data,offset) sets data in the buffer-->
<!-- GIDEROSMTD:Buffer:prepend(data) adds data at the beginning of the buffer -->
+
[[Buffer:get]] ''gets data from the buffer''<br/><!--GIDEROSMTD:Buffer:get(offset,size) gets data from the buffer-->
[[Special:MyLanguage/Buffer:trim|Buffer:trim]] ''<translate>remove data from the start or the end of the buffer</translate>''<br/>
+
[[Buffer:size]] ''gets the buffer size''<br/><!--GIDEROSMTD:Buffer:size() gets the buffer size-->
<!-- GIDEROSMTD:Buffer:trim(amount) remove data from the start or the end of the buffer -->
+
[[Buffer:seek]] ''sets the position of the next file access''<br/><!--GIDEROSMTD:Buffer:seek(offset) sets the position of the next file access-->
[[Special:MyLanguage/Buffer:set|Buffer:set]] ''<translate>sets data in the buffer</translate>''<br/>
+
[[Buffer:tell]] ''gets the position of the next file access''<br/><!--GIDEROSMTD:Buffer:tell() gets the position of the next file access-->
<!-- GIDEROSMTD:Buffer:set(data,offset) sets data in the buffer -->
 
[[Special:MyLanguage/Buffer:get|Buffer:get]] ''<translate>gets data from the buffer</translate>''<br/>
 
<!-- GIDEROSMTD:Buffer:get(offset,size) gets data from the buffer -->
 
[[Special:MyLanguage/Buffer:size|Buffer:size]] ''<translate>gets the buffer size</translate>''<br/>
 
<!-- GIDEROSMTD:Buffer:size() gets the buffer size -->
 
[[Special:MyLanguage/Buffer:seek|Buffer:seek]] ''<translate>sets the position of the next file access</translate>''<br/>
 
<!-- GIDEROSMTD:Buffer:seek(offset) sets the position of the next file access -->
 
[[Special:MyLanguage/Buffer:tell|Buffer:tell]] ''<translate>gets the position of the next file access</translate>''<br/>
 
<!-- GIDEROSMTD:Buffer:tell() gets the position of the next file access -->
 
  
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
=== <translate>Events</translate> ===
+
=== Events ===
=== <translate>Constants</translate> ===
+
=== Constants ===
 
|}
 
|}
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Revision as of 01:09, 23 March 2022

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2020.2
Inherits from: Object

Description

The Buffer class acts as FIFO buffer with Gideros internal file system integration.

At lua side, Buffers are created with a name, and data can be added or taken from them.

Once created, buffer data can also be accessed by internal gideros functions that normally use files, such as textures or sounds. To do that pass |B|buffer.ext as the file name, where buffer.ext is that name of the buffer.

Methods

Buffer.new creates a new Buffer object
Buffer:append adds data at the end of the buffer
Buffer:prepend adds data at the beginning of the buffer
Buffer:trim removes data from the start or the end of the buffer
Buffer:set sets data in the buffer
Buffer:get gets data from the buffer
Buffer:size gets the buffer size
Buffer:seek sets the position of the next file access
Buffer:tell gets the position of the next file access

Events

Constants