Class: Wx::FSFile
Overview
This class represents a single file opened by FileSystem.
It provides more information than wxWidgets’ input streams (stream, filename, mime type, anchor).
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
Instance Method Summary collapse
-
#detach_stream ⇒ Wx::InputStream
Detaches the stream from the FSFile object.
-
#get_anchor ⇒ Wx::String
(also: #anchor)
Returns anchor (if present).
-
#get_location ⇒ Wx::String
(also: #location)
Returns full location of the file, including path and protocol.
-
#get_mime_type ⇒ Wx::String
(also: #mime_type)
Returns the MIME type of the content of this file.
-
#get_modification_time ⇒ Time, ...
(also: #modification_time)
Returns time when this file was modified.
-
#get_stream ⇒ Wx::InputStream
(also: #stream)
Returns pointer to the stream.
-
#initialize(stream, location, mimetype, anchor, modif) ⇒ Wx::FSFile
constructor
Constructor.
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.
98 |
# File 'lib/wx/doc/gen/fs_file.rb', line 98 def initialize(stream, location, mimetype, anchor, modif) end |
Instance Method Details
#detach_stream ⇒ Wx::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.
105 |
# File 'lib/wx/doc/gen/fs_file.rb', line 105 def detach_stream; end |
#get_anchor ⇒ Wx::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.
117 |
# File 'lib/wx/doc/gen/fs_file.rb', line 117 def get_anchor; end |
#get_location ⇒ Wx::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
127 |
# File 'lib/wx/doc/gen/fs_file.rb', line 127 def get_location; end |
#get_mime_type ⇒ Wx::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.
134 |
# File 'lib/wx/doc/gen/fs_file.rb', line 134 def get_mime_type; end |
#get_modification_time ⇒ Time, ... Also known as: modification_time
Returns time when this file was modified.
139 |
# File 'lib/wx/doc/gen/fs_file.rb', line 139 def get_modification_time; end |
#get_stream ⇒ Wx::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).
146 |
# File 'lib/wx/doc/gen/fs_file.rb', line 146 def get_stream; end |