wx.FileSys.FileSystemHandler Class Reference

Inheritance diagram for wx.FileSys.FileSystemHandler:

wx.Object wx.FileSys.InternetFSHandler wx.FileSys.IOStreamFSHandler wx.FileSys.MemoryFSHandler wx.FileSys.ZipFSHandler

List of all members.

Public Member Functions

virtual bool CanOpen (string location)
virtual string FindFirst (string wildcard, KindOfFile kindOfFile)
virtual string FindNext ()
string GetMimeTypeFromExt (string location)
abstract FSFile OpenFile (FileSystem fs, string location)

Static Public Member Functions

static string MimeTypeFromExt (string location)

Protected Member Functions

Methods to divide a location into protocol, left location, right location, and anchor.
string GetAnchor (string location)
string GetLeftLocation (string location)
string GetProtocol (string location)
string GetRightLocation (string location)

Detailed Description

This class wrapps wxWidgets class wxFileSystemHandler and all inheritors. Investigate the documetnation of subclasses for details on predefined file system handlers. For instance class IOStreamFSHandler enables the implementation of wxWidgets file system handlers as streams of the .NET framework.

Member Function Documentation

virtual bool wx.FileSys.FileSystemHandler.CanOpen ( string  location  )  [virtual]

The handler identifies himself with result true to be appropriate to deal with a file at the provided location. Example: A handler for the HTTP protocol over the internet could answer here with

         return this.GetProtocol(location) == "http";

Please note, that this method should also work with the allowed wildcards, since this method also works as a filter for FindFirst().

Reimplemented in wx.FileSys.IOStreamFSHandler.

virtual string wx.FileSys.FileSystemHandler.FindFirst ( string  wildcard,
KindOfFile  kindOfFile 
) [virtual]

Returns the first matching filename or an empty string if nothing matches. This will only be called if the wildcard can be opened (CanOpen()).

Reimplemented in wx.FileSys.IOStreamFSHandler.

virtual string wx.FileSys.FileSystemHandler.FindNext (  )  [virtual]

Returns the next filename matching with the constraints of the previous FindFirst() or an empty string if nothing matches.

Reimplemented in wx.FileSys.IOStreamFSHandler.

string wx.FileSys.FileSystemHandler.GetAnchor ( string  location  )  [protected]

Returns the anchor if present in the location. Example:

 GetAnchor("index.htm#chapter2") == "chapter2"

Note: the anchor is NOT part of the left location.

string wx.FileSys.FileSystemHandler.GetLeftLocation ( string  location  )  [protected]

Returns the left location string extracted from location. Example:

 GetLeftLocation("file:myzipfile.zip#zip:index.htm") == "file:myzipfile.zip"

string wx.FileSys.FileSystemHandler.GetMimeTypeFromExt ( string  location  ) 

Returns the MIME type based on extension of location. (While FSFile.MimeType returns real MIME type - either extension-based or queried from HTTP.) However, particular handlers may use this to generate an FSFile of an appropriate mime type if nothing particular is known on such things.

Example :

 this.GetMimeTypeFromExt("index.htm") == "text/html"

string wx.FileSys.FileSystemHandler.GetProtocol ( string  location  )  [protected]

Returns the protocol string extracted from location.

Example: GetProtocol("file:myzipfile.zip#zip:index.htm") == "zip"

string wx.FileSys.FileSystemHandler.GetRightLocation ( string  location  )  [protected]

Returns the right location string extracted from location. Example :

 GetRightLocation("file:myzipfile.zip#zip:/index.htm") == "/index.htm"

static string wx.FileSys.FileSystemHandler.MimeTypeFromExt ( string  location  )  [static]

A static public version of GetMimeTypeFromExt() running on a particular, transparently generated instance. This method may be changed in order to add some support for additional types.

abstract FSFile wx.FileSys.FileSystemHandler.OpenFile ( FileSystem  fs,
string  location 
) [pure virtual]

Returns an instance of FSFile that provides a stream over the data as denoted by location.

location absolute location of the desired data.
fs is the parent file system. This parameter still exists maybe because of historical reasons. The manual 2.6.3. refers to wxZipFSHandler as a reference for using this parameter but this class in the meanwhile explicitely refers to a freshly created file system to avoid infinite recursions (as the remark says).

Implemented in wx.FileSys.ZipFSHandler, wx.FileSys.InternetFSHandler, wx.FileSys.MemoryFSHandler, and wx.FileSys.IOStreamFSHandler.

Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads