# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # This class provides an interface for opening files on different file systems. # # It can handle absolute and/or local filenames. # It uses a system of handlers (see {Wx::FileSystemHandler}) to provide access to user-defined virtual file systems. # # Category: Virtual File System # @see Wx::FileSystemHandler # @see Wx::FSFile # @see wxFileSystem Overview # # # # @note This class is untracked and should not be derived from nor instances extended! # @wxrb_require USE_FILESYSTEM class FileSystem < Object # Constructor. # # The initial current path of this object will be empty (i.e. {Wx::FileSystem#get_path} == {Wx::EmptyString}) which means that e.g. {Wx::FileSystem#open_file} or {Wx::FileSystem#find_first} functions will use current working directory as current path (see also {Wx::GetCwd}). # @return [Wx::FileSystem] def initialize; end # Remove a filesystem handler from the list of handlers. # @param handler [Wx::FileSystemHandler] # @return [Wx::FileSystemHandler] def self.remove_handler(handler) end # Converts a {Wx::FileName} into an URL. # # # @see Wx::FileSystem.url_to_file_name # @see Wx::FileName # @param filename [String] # @return [String] def self.file_name_to_url(filename) end # This static function returns true if there is a registered handler which can open the given location. # @param location [String] # @return [Boolean] def self.has_handler_for_path(location) end # Converts URL into a well-formed filename. # # The URL must use the file protocol. # @param url [String] # @return [String] def self.url_to_file_name(url) end end # FileSystem # Classes derived from {Wx::FileSystemHandler} are used to access virtual file systems. # # Its public interface consists of two methods: {Wx::FileSystemHandler#can_open} and {Wx::FileSystemHandler#open_file}. # It provides additional protected methods to simplify the process of opening the file: {Wx::FileSystemHandler.get_protocol}, {Wx::FileSystemHandler.get_left_location}, {Wx::FileSystemHandler.get_right_location}, {Wx::FileSystemHandler.get_anchor}, {Wx::FileSystemHandler.get_mime_type_from_ext}. # Please have a look at overview (see {Wx::FileSystem}) if you don't know how locations are constructed. # Also consult the list of available handlers. # Note that the handlers are shared by all instances of {Wx::FileSystem}. # #
# Remark: #

{Wx::HTML} library provides handlers for local files and HTTP or FTP protocol. #

#
# #
# Note: #

The location parameter passed to {Wx::FileSystemHandler#open_file} or {Wx::FileSystemHandler#can_open} methods is always an absolute path. You don't need to check the FS's current path. #

#
# # Category: Virtual File System # @see Wx::FileSystem # @see Wx::FSFile # @see wxFileSystem Overview # # # @wxrb_require USE_FILESYSTEM class FileSystemHandler < Object # Constructor. # @return [Wx::FileSystemHandler] def initialize; end # Returns true if the handler is able to open this file. # # This function doesn't check whether the file exists or not, it only checks if it knows the protocol. # # Must be overridden in derived handlers. # @param location [String] # @return [Boolean] def can_open(location) end alias_method :can_open?, :can_open # Works like {find_first_file}. # # Returns the name of the first filename (within filesystem's current path) that matches wildcard. flags may be one of {Wx::FILE} (only files), {Wx::DIR} (only directories) or 0 (both). # This method is only called if {Wx::FileSystemHandler#can_open} returns true. # @param wildcard [String] # @param flags [Integer] # @return [String] def find_first(wildcard, flags=0) end # Returns next filename that matches parameters passed to {Wx::FileSystem#find_first}. # # This method is only called if {Wx::FileSystemHandler#can_open} returns true and {Wx::FileSystemHandler#find_first} returned a non-empty string. # @return [String] def find_next; end # Opens the file and returns {Wx::FSFile} pointer or NULL if failed. # # Must be overridden in derived handlers. # @param fs [Wx::FileSystem] Parent FS (the FS from that OpenFile was called). See the ZIP handler for details of how to use it. # @param location [String] The absolute location of file. # @return [Wx::FSFile] def open_file(fs, location) end # Returns the MIME type based on extension of location. # # (While {Wx::FSFile#get_mime_type} returns real MIME type - either extension-based or queried from HTTP.) # @param location [String] # @return [String] def self.get_mime_type_from_ext(location) end end # FileSystemHandler # A file system handler for accessing files inside of archives. # # # # @wxrb_require USE_FILESYSTEM class ArchiveFSHandler < FileSystemHandler # @return [Wx::ArchiveFSHandler] def initialize; end # @return [void] def cleanup; end end # ArchiveFSHandler # This {Wx::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 {Wx::HTML} or {Wx::WebView}. # Filenames are prefixed with "memory:", e.g. "memory:myfile.html". # # Category: Virtual File System # @see Wx::MemoryFSHandler.add_file_with_mime_type # # # @wxrb_require USE_FILESYSTEM class MemoryFSHandler < FileSystemHandler # @overload self.add_file(filename, image, type) # 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 {Wx::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 {Wx::Image} documentation)! #

#
# @see Wx::MemoryFSHandler.add_file_with_mime_type # @param filename [String] # @param image [Wx::Image] # @param type [Wx::BitmapType] # @return [void] # @overload self.add_file(filename, bitmap, type) # 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 {Wx::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 {Wx::Image} documentation)! #

#
# @see Wx::MemoryFSHandler.add_file_with_mime_type # @param filename [String] # @param bitmap [Wx::Bitmap] # @param type [Wx::BitmapType] # @return [void] # @overload self.add_file(filename, textdata) # 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 {Wx::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 {Wx::Image} documentation)! #

#
# @see Wx::MemoryFSHandler.add_file_with_mime_type # @param filename [String] # @param textdata [String] # @return [void] def self.add_file(*args) end # Like {Wx::MemoryFSHandler.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. # @see Wx::MemoryFSHandler.add_file # @param filename [String] # @param textdata [String] # @param mimetype [String] # @return [void] def self.add_file_with_mime_type(filename, textdata, mimetype) end # Constructor. # @return [Wx::MemoryFSHandler] def initialize; end # Removes a file from memory FS and frees the occupied memory. # @param filename [String] # @return [void] def self.remove_file(filename) end end # MemoryFSHandler end