- G
- R
- S
Source: show
static VALUE io_getch(int argc, VALUE *argv, VALUE io) { return rb_funcall2(io, rb_intern("getc"), argc, argv); }
Similar to read, but raises EOFError
at end of string instead
of returning nil
, as well as IO#sysread does.
Source: show
static VALUE strio_sysread(int argc, VALUE *argv, VALUE self) { VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv); if (NIL_P(val)) { rb_eof_error(); } return val; }
See IO#readbyte.
Source: show
static VALUE strio_readbyte(VALUE self) { VALUE c = rb_funcall2(self, rb_intern("getbyte"), 0, 0); if (NIL_P(c)) rb_eof_error(); return c; }
See IO#readchar.
Source: show
static VALUE strio_readchar(VALUE self) { VALUE c = rb_funcall2(self, rb_intern("getc"), 0, 0); if (NIL_P(c)) rb_eof_error(); return c; }
See IO#readline.
Source: show
static VALUE strio_readline(int argc, VALUE *argv, VALUE self) { VALUE line = rb_funcall2(self, rb_intern("gets"), argc, argv); if (NIL_P(line)) rb_eof_error(); return line; }
Similar to read, but raises EOFError
at end of string instead
of returning nil
, as well as IO#sysread does.
Source: show
static VALUE strio_sysread(int argc, VALUE *argv, VALUE self) { VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv); if (NIL_P(val)) { rb_eof_error(); } return val; }
Similar to read, but raises EOFError
at end of string instead
of returning nil
, as well as IO#sysread does.
Source: show
static VALUE strio_sysread(int argc, VALUE *argv, VALUE self) { VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv); if (NIL_P(val)) { rb_eof_error(); } return val; }