Sha256: ecc6562d37427b1f9806fe8f2e4189d3baeb6e852778b5eeb06f4c748878dfbb
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>read (Rev::Buffer)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre>/** * call-seq: * Rev::Buffer#read(length = nil) -> String * * Read the specified abount of data from the buffer. If no value * is given the entire contents of the buffer are returned. Any data * read from the buffer is cleared. */ static VALUE Rev_Buffer_read(int argc, VALUE *argv, VALUE self) { VALUE length_obj, str; int length; struct buffer *buf; Data_Get_Struct(self, struct buffer, buf); if(rb_scan_args(argc, argv, "01", &length_obj) == 1) { length = NUM2INT(length_obj); } else { if(buf->size == 0) return rb_str_new2(""); length = buf->size; } if(length > buf->size) length = buf->size; if(length < 1) rb_raise(rb_eArgError, "length must be greater than zero"); str = rb_str_new(0, length); buffer_read(buf, RSTRING_PTR(str), length); return str; }</pre> </body> </html>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rev-0.1.2 | doc/rdoc/classes/Rev/Buffer.src/M000026.html |