class

ImGui::TextBuffer

Inherits IO < Reference < Object

Constructors

new(string : String, capacity : Int32 = string.bytesize)
Source
new(string : Bytes, capacity : Int32 = string.bytesize)
Source
new(capacity : Int32 = 0)
Source

Instance methods

bytesize
Source
capacity
Source
clear
Source
read(slice)
Source
resize(size : Int32) : Nil
Source
to_s(io : IO)

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
to_slice
Source
to_unsafe
Source
write(slice : Bytes) : Nil

Writes the contents of slice into this IO.

io = IO::Memory.new
slice = Bytes.new(4) { |i| ('a'.ord + i).to_u8 }
io.write(slice)
io.to_s # => "abcd"
Source