A buffer can store any value as a string and will only allocate the total needed space when requested. It makes a copy of each value when stored so modifying them after is not a problem.

'buffer buffer_new() Allocate a new empty buffer void buffer_add('buffer, any) Add a value to a buffer void buffer_add_char('buffer, c : int) Add a single char to a buffer. Error if c is not in the 0..255 range void buffer_add_sub('buffer, s : string, p : int, l : int) Add l characters of the string s starting at position p. An error occurs if out of string bounds. string buffer_string('buffer) Build and return the string built with the buffer void buffer_reset('buffer) Make the buffer empty
Report an issue | Contribute to this page

©2017 Haxe Foundation