Class: RIO::Stream::IOBase

Inherits:
Base show all
Includes:
Ops::Path::Str, Ops::Stream::Manip, Ops::Stream::Status
Defined in:
lib/rio/stream.rb

Direct Known Subclasses

InOut, Input, Output

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Ops::Stream::Manip

#flush, #fsync, #isatty, #pid, #seek, #to_io, #tty?

Methods included from Fwd

#fwd, #fwd_reader, #fwd_readers, #fwd_writer, #fwd_writers

Methods included from Ops::Stream::Status

#closed?, #eof?, #open?, #stat

Methods included from Ops::Path::ExistOrNot

#symlink

Methods included from Ops::Path::URI

#abs, #absolute?, #base, #merge, #rel, #route_from, #route_to, #setbase

Methods included from Ops::Path::Create

#/, #cleanpath, #cwd, #getwd, #join, #join!, #rootpath

Methods included from Ops::Path::Query

#+, #basename, #dirname, #expand_path, #extname, #filename, #gsub, #normalize, #splitpath, #sub

Methods included from Ops::Path::Status

#atime, #ctime, #executable?, #executable_real?, #fnmatch, #fnmatch?, #ftype, #grpowned?, #mtime, #owned?, #readable?, #readable_real?, #root?, #setgid?, #setuid?, #size, #size?, #stat, #sticky?, #writable?, #writable_real?, #zero?

Methods included from Ops::Path::Test

#blockdev?, #chardev?, #closed?, #directory?, #exist?, #file?, #open?, #pipe?, #socket?, #symlink?

Methods inherited from Base

#to_a

Class Method Details

.copier(src, dst) ⇒ Object



87
88
89
# File 'lib/rio/stream.rb', line 87

def self.copier(src,dst)
  RIO::Copy::Strategy::Stream.instance.copier(src,dst)
end

Instance Method Details

#add_filter(mod) ⇒ Object



75
76
77
78
79
# File 'lib/rio/stream.rb', line 75

def add_filter(mod)
  unless ioh.kind_of?(mod)
    ioh.extend(mod)
  end
end

#base_stateObject



65
# File 'lib/rio/stream.rb', line 65

def base_state() 'Stream::Close' end

#check?Boolean

Returns:

  • (Boolean)


60
# File 'lib/rio/stream.rb', line 60

def check?() open? end

#rectype_modObject



80
81
82
83
84
85
86
# File 'lib/rio/stream.rb', line 80

def rectype_mod
  case cx['stream_rectype']
  when 'lines' then RIO::RecType::Lines
  when 'bytes' then RIO::RecType::Bytes
  else RIO::RecType::Lines
  end
end

#resetObject



66
67
68
# File 'lib/rio/stream.rb', line 66

def reset()
  self.close.softreset()
end

#setupObject



69
70
71
72
73
74
# File 'lib/rio/stream.rb', line 69

def setup
  ioh.sync = sync? if cx.has_key?('sync')

  ioh.set_encoding(*enc?) if cx.has_key?(:enc_args)
  self
end

#when_missing(sym, *args) ⇒ Object



61
62
63
64
# File 'lib/rio/stream.rb', line 61

def when_missing(sym,*args) 
  #p callstr('when_missing',sym,*args)
  retryreset() 
end