lib/rio/context/stream.rb in rio-0.3.8 vs lib/rio/context/stream.rb in rio-0.3.9
- old
+ new
@@ -1,8 +1,8 @@
#--
# ===============================================================================
-# Copyright (c) 2005, 2006 Christopher Kleckner
+# Copyright (c) 2005,2006,2007 Christopher Kleckner
# All rights reserved
#
# This file is part of the Rio library for ruby.
#
# Rio is free software; you can redistribute it and/or modify
@@ -21,20 +21,19 @@
# ===============================================================================
#++
#
# To create the documentation for Rio run the command
# ruby build_doc.rb
-# from the distribution directory. Then point your browser at the 'doc/rdoc' directory.
+# from the distribution directory.
#
# Suggested Reading
# * RIO::Doc::SYNOPSIS
# * RIO::Doc::INTRO
# * RIO::Doc::HOWTO
+# * RIO::Doc::EXAMPLES
# * RIO::Rio
#
-# <b>Rio is pre-alpha software.
-# The documented interface and behavior is subject to change without notice.</b>
require 'rio/context/cxx.rb'
require 'rio/iomode'
@@ -119,10 +118,21 @@
#p callstr('lines_',*args)
_set_sstype('lines',false)
_lines(args,_sel,false,&block)
end
+ def line(*args,&block)
+ #p callstr('line',*args)
+ cx['line'] = true
+ self.lines(*args,&block)
+ end
+ def line_(*args,&block)
+ #p callstr('line_',*args)
+ cx.set_('line',true)
+ self.lines_(*args,&block)
+ end
+
def records(*args,&block)
if skipping?
cx['skipping'] = false
skiprecords(*args,&block)
else
@@ -133,10 +143,21 @@
def records_(*args,&block)
_set_sstype('records',false)
_records(args,_sel,false,&block)
end
+ def record(*args,&block)
+ #p callstr('record',*args)
+ cx['record'] = true
+ self.records(*args,&block)
+ end
+ def record_(*args,&block)
+ #p callstr('record_',*args)
+ cx.set_('record',true)
+ self.records_(*args,&block)
+ end
+
def rows(*args,&block)
if skipping?
cx['skipping'] = false
skiprows(*args,&block)
else
@@ -147,20 +168,36 @@
def rows_(*args,&block)
_set_sstype('rows',false)
_rows(args,_sel,false,&block)
end
+ def row(*args,&block)
+ #p callstr('row',*args)
+ cx['row'] = true
+ self.rows(*args,&block)
+ end
+ def row_(*args,&block)
+ #p callstr('row_',*args)
+ cx.set_('row',true)
+ self.rows_(*args,&block)
+ end
+
def skiplines(*args,&block)
#p callstr('skiplines',*args)
self.lines() unless args.empty? or cx.has_key?('stream_sel')
_set_sstype('skiplines')
_lines(args,false,&block)
end
def skiprecords(*args,&block)
- self.records() unless args.empty? or cx.has_key?('stream_sel')
+ self.records_() unless args.empty? or cx.has_key?('stream_sel')
_set_sstype('skiprecords')
_records(args,false,&block)
+ end
+ def skiprecords_(*args,&block)
+ self.records_() unless args.empty? or cx.has_key?('stream_sel')
+ _set_sstype('skiprecords',false)
+ _records(args,false,false,&block)
end
def skiprows(*args,&block)
self.rows() unless args.empty? or cx.has_key?('stream_sel')
_set_sstype('skiprows')
_rows(args,false,&block)