Class: Wx::InputStream

Inherits:
StreamBase show all
Defined in:
lib/wx/doc/gen/fs_file.rb,
lib/wx/doc/stream.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

InputStream is an abstract base class which may not be used directly.

It is the base class of all streams which provide a #read function, i.e. which can be used to read data from a source (e.g. a file, a socket, etc). If you want to create your own input stream, you’ll need to derive from this class and implement the protected on_sys_read function only.

Category: Streams

Requires:

  • USE_FILESYSTEM

Instance Method Summary collapse

Methods inherited from StreamBase

#get_last_error, #get_length, #get_size, #is_ok, #is_seekable, #reset

Constructor Details

#initializeWx::InputStream

Creates a dummy input stream.



227
# File 'lib/wx/doc/gen/fs_file.rb', line 227

def initialize; end

Instance Method Details

#can_readBoolean Also known as: can_read?

Returns true if some data is available in the stream right now, so that calling #read wouldn’t block.

Returns:

  • (Boolean)


231
# File 'lib/wx/doc/gen/fs_file.rb', line 231

def can_read; end

#eofBoolean

Returns true after an attempt has been made to read past the end of the stream.

Returns:

  • (Boolean)


236
# File 'lib/wx/doc/gen/fs_file.rb', line 236

def eof; end

#get_cInteger Also known as: c

Returns the first character in the input queue and removes it, blocking until it appears if necessary.

On success returns a value between 0 - 255; on end of file returns EOF.

Returns:

  • (Integer)


242
# File 'lib/wx/doc/gen/fs_file.rb', line 242

def get_c; end

#last_readInteger

Returns the last number of bytes read.

Returns:

  • (Integer)


247
# File 'lib/wx/doc/gen/fs_file.rb', line 247

def last_read; end

#peekInteger

Returns the first character in the input queue without removing it.

Returns:

  • (Integer)


251
# File 'lib/wx/doc/gen/fs_file.rb', line 251

def peek; end

#read(stream_out) ⇒ Wx::InputStream

Reads data from the input queue and stores it in the specified output stream.

The data is read until an error is raised by one of the two streams. This function returns a reference on the current object, so the user can test any states of the stream right away.

Parameters:

Returns:



20
# File 'lib/wx/doc/stream.rb', line 20

def read(*args); end

#read_all(size) ⇒ Object

Reads size bytes from stream (until eof or error). @param [Integer] size number of bytes to read @return [String,nil] string with bytes read (nil if none read)



25
# File 'lib/wx/doc/stream.rb', line 25

def read_all(size); end

#seek_i(pos, mode = Wx::SeekMode::FromStart) ⇒ Integer

Changes the stream current position.

This operation in general is possible only for seekable streams (see StreamBase#is_seekable); non-seekable streams support only seeking positive amounts in mode SeekMode::FromCurrent (this is implemented by reading data and simply discarding it).

The new stream position or Wx::InvalidOffset on error.

Parameters:

Returns:

  • (Integer)


269
# File 'lib/wx/doc/gen/fs_file.rb', line 269

def seek_i(pos, mode=Wx::SeekMode::FromStart) end

#tell_iInteger

Returns the current stream position or Wx::InvalidOffset if it’s not available (e.g.

socket streams do not have a size nor a current stream position).

Returns:

  • (Integer)


275
# File 'lib/wx/doc/gen/fs_file.rb', line 275

def tell_i; end

#ungetch(c) ⇒ Boolean

This function acts like the previous one except that it takes only one character: it is sometimes shorter to use than the generic function.

Parameters:

  • c (Integer)

Returns:

  • (Boolean)


280
# File 'lib/wx/doc/gen/fs_file.rb', line 280

def ungetch(c) end