class Gio::DataInputStream

Public Instance Methods

each() { |line| ... } click to toggle source
# File lib/gio2.rb, line 19
def each
  while line = read_line
    yield line
  end
end
Also aliased as: each_line
each_async(io_priority = GLib::PRIORITY_DEFAULT, cancellable = nil, &block) click to toggle source
# File lib/gio2.rb, line 27
def each_async(io_priority = GLib::PRIORITY_DEFAULT, cancellable = nil, &block)
  each_async_loop io_priority, cancellable, block
  self
end
Also aliased as: each_line_async
each_line()
Alias for: each
each_line_async(io_priority = GLib::PRIORITY_DEFAULT, cancellable = nil, &block)
Alias for: each_async

Private Instance Methods

each_async_loop(io_priority, cancellable, block) click to toggle source
# File lib/gio2.rb, line 36
def each_async_loop(io_priority, cancellable, block)
  # TODO: Should we really pass in the object?  I mean, how often is that
  # useful?  We can always get it with result.source_object as well.
  read_line_async io_priority, cancellable do |result|
    if line = read_line_finish(result)
      block.call line
      each_async_loop io_priority, cancellable, block
    end
  end
end