Class: Wx::FSFile

Inherits:
Object show all
Defined in:
lib/wx/doc/gen/fs_file.rb

Overview

This class represents a single file opened by FileSystem.

It provides more information than wxWidgets’ input streams (stream, filename, mime type, anchor).

Note:

Any pointer returned by a method of FSFile is valid only as long as the FSFile object exists. For example a call to #get_stream doesn't create the stream but only returns the pointer to it. In other words after 10 calls to #get_stream you will have obtained ten identical pointers.

Category: Virtual File System, File Handling

See Also:

Requires:

  • USE_FILESYSTEM

Instance Method Summary collapse

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initialize(stream, location, mimetype, anchor, modif) ⇒ Wx::FSFile

Constructor.

You probably won’t use it. See the Note for details.

If you are not sure of the meaning of these params, see the description of the GetXXXX() functions.

Parameters:

  • stream (IO)

    The input stream that will be used to access data

  • location (String)

    The full location (aka filename) of the file

  • mimetype (String)

    MIME type of this file. It may be left empty, in which case the type will be determined from file’s extension (location must not be empty in this case).

  • anchor (String)

    Anchor. See #get_anchor for details.

  • modif (Time, Date, DateTime)

    Modification date and time for this file.



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

def initialize(stream, location, mimetype, anchor, modif) end

Instance Method Details

#detach_streamWx::InputStream

Detaches the stream from the Wx::FSFile object.

That is, the stream obtained with #get_stream will continue its existence after the Wx::FSFile object is deleted. You will have to delete the stream yourself.

Returns:



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

def detach_stream; end

#get_anchorWx::String Also known as: anchor

Returns anchor (if present).

The term of anchor can be easily explained using few examples: index.htm#anchor // ‘anchor’ is anchor index/001.htm // NO anchor here! archive/main.zip#zip:index.htm#global // ‘global’ archive/main.zip#zip:index.htm // NO anchor here!

Usually an anchor is presented only if the MIME type is ‘text/html’. But it may have some meaning with other files; for example myanim.avi#200 may refer to position in animation or reality.wrl::MyView may refer to a predefined view in VRML.

Returns:

  • (Wx::String)


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

def get_anchor; end

#get_locationWx::String Also known as: location

Returns full location of the file, including path and protocol.

Examples: www.widgets.org www.ms.mff.cuni.cz/~vsla8348/html/archive.zip#zip:info.txt file:/home/vasek/index.htm relative-file.htm

Returns:

  • (Wx::String)


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

def get_location; end

#get_mime_typeWx::String Also known as: mime_type

Returns the MIME type of the content of this file.

It is either extension-based (see MimeTypesManager) or extracted from HTTP protocol Content-Type header.

Returns:

  • (Wx::String)


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

def get_mime_type; end

#get_modification_timeTime, ... Also known as: modification_time

Returns time when this file was modified.

Returns:

  • (Time, Date, DateTime)


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

def get_modification_time; end

#get_streamWx::InputStream Also known as: stream

Returns pointer to the stream.

You can use the returned stream to directly access data. You may suppose that the stream provide Seek and GetSize functionality (even in the case of the HTTP protocol which doesn’t provide this by default. HTML uses local cache to work around this and to speed up the connection).

Returns:



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

def get_stream; end