Class: Wx::MemoryFSHandler

Inherits:
FileSystemHandler show all
Defined in:
lib/wx/doc/gen/file_system.rb

Overview

This FileSystem handler can store arbitrary data in memory stream and make them accessible via an URL.

It is particularly suitable for storing bitmaps from resources or included XPM files so that they can be used with HTML or WebView. Filenames are prefixed with "memory:", e.g. "memory:myfile.html".

Category: Virtual File System

See Also:

Requires:

  • USE_FILESYSTEM

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FileSystemHandler

#can_open, #find_first, #find_next, get_mime_type_from_ext, #open_file

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initializeWx::MemoryFSHandler

Constructor.



222
# File 'lib/wx/doc/gen/file_system.rb', line 222

def initialize; end

Class Method Details

.self.add_file(filename, image, type) ⇒ void .self.add_file(filename, bitmap, type) ⇒ void .self.add_file(filename, textdata) ⇒ void

Overloads:

  • .self.add_file(filename, image, type) ⇒ void

    This method returns an undefined value.

    Adds a file to the list of the files stored in memory.

    Stored data (bitmap, text or raw data) will be copied into private memory stream and available under name "memory:" + filename. When using the overload taking String data, if the string contains only Latin-1 characters (which includes strings created using Wx::String#from8bit_data), its data is used as is. Otherwise, the UTF-8 representation of the string is stored as the data associated with the given filename.

    Note:

    you must use a type value (aka image format) that wxWidgets can save (e.g. JPG, PNG, see Image documentation)!

    Parameters:

    See Also:

  • .self.add_file(filename, bitmap, type) ⇒ void

    This method returns an undefined value.

    Adds a file to the list of the files stored in memory.

    Stored data (bitmap, text or raw data) will be copied into private memory stream and available under name "memory:" + filename. When using the overload taking String data, if the string contains only Latin-1 characters (which includes strings created using Wx::String#from8bit_data), its data is used as is. Otherwise, the UTF-8 representation of the string is stored as the data associated with the given filename.

    Note:

    you must use a type value (aka image format) that wxWidgets can save (e.g. JPG, PNG, see Image documentation)!

    Parameters:

    See Also:

  • .self.add_file(filename, textdata) ⇒ void

    This method returns an undefined value.

    Adds a file to the list of the files stored in memory.

    Stored data (bitmap, text or raw data) will be copied into private memory stream and available under name "memory:" + filename. When using the overload taking String data, if the string contains only Latin-1 characters (which includes strings created using Wx::String#from8bit_data), its data is used as is. Otherwise, the UTF-8 representation of the string is stored as the data associated with the given filename.

    Note:

    you must use a type value (aka image format) that wxWidgets can save (e.g. JPG, PNG, see Image documentation)!

    Parameters:

    • filename (String)
    • textdata (String)

    See Also:



208
# File 'lib/wx/doc/gen/file_system.rb', line 208

def self.add_file(*args) end

.add_file_with_mime_type(filename, textdata, mimetype) ⇒ void

This method returns an undefined value.

Like add_file, but lets you explicitly specify added file’s MIME type.

This version should be used whenever you know the MIME type, because it makes accessing the files faster.

Parameters:

  • filename (String)
  • textdata (String)
  • mimetype (String)

See Also:



218
# File 'lib/wx/doc/gen/file_system.rb', line 218

def self.add_file_with_mime_type(filename, textdata, mimetype) end

.remove_file(filename) ⇒ void

This method returns an undefined value.

Removes a file from memory FS and frees the occupied memory.

Parameters:

  • filename (String)


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

def self.remove_file(filename) end