]> git.saurik.com Git - wxWidgets.git/blame - docs/doxygen/overviews/filesystem.h
renamed some topic overviews to a more readable filename
[wxWidgets.git] / docs / doxygen / overviews / filesystem.h
CommitLineData
15b6757b
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: fs
3// Purpose: topic overview
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/*!
36c9828f 10
15b6757b 11 @page fs_overview wxFileSystem
36c9828f 12
15b6757b
FM
13 The wxHTML library uses a @b virtual file systems mechanism
14 similar to the one used in Midnight Commander, Dos Navigator,
15 FAR or almost any modern file manager. It allows the user to access
16 data stored in archives as if they were ordinary files. On-the-fly
17 generated files that exist only in memory are also supported.
18 @b Classes
19 Three classes are used in order to provide virtual file systems mechanism:
36c9828f
FM
20
21
15b6757b
FM
22 The #wxFSFile class provides information
23 about opened file (name, input stream, mime type and anchor).
24 The #wxFileSystem class is the interface.
25 Its main methods are ChangePathTo() and OpenFile(). This class
26 is most often used by the end user.
27 The #wxFileSystemHandler is the core
28 of virtual file systems mechanism. You can derive your own handler and pass it to
29 the VFS mechanism. You can derive your own handler and pass it to
30 wxFileSystem's AddHandler() method. In the new handler you only need to
31 override the OpenFile() and CanOpen() methods.
36c9828f
FM
32
33
15b6757b
FM
34 @b Locations
35 Locations (aka filenames aka addresses) are constructed from four parts:
36c9828f
FM
36
37
15b6757b
FM
38 @b protocol - handler can recognize if it is able to open a
39 file by checking its protocol. Examples are "http", "file" or "ftp".
40 @b right location - is the name of file within the protocol.
41 In "http://www.wxwidgets.org/index.html" the right location is "//www.wxwidgets.org/index.html".
42 @b anchor - an anchor is optional and is usually not present.
43 In "index.htm#chapter2" the anchor is "chapter2".
36c9828f 44 @b left location - this is usually an empty string.
15b6757b
FM
45 It is used by 'local' protocols such as ZIP.
46 See Combined Protocols paragraph for details.
36c9828f
FM
47
48
15b6757b 49 @b Combined Protocols
36c9828f 50 The left location precedes the protocol in the URL string.
15b6757b
FM
51 It is not used by global protocols like HTTP but it becomes handy when nesting
52 protocols - for example you may want to access files in a ZIP archive:
53 file:archives/cpp_doc.zip#zip:reference/fopen.htm#syntax
54 In this example, the protocol is "zip", right location is
55 "reference/fopen.htm", anchor is "syntax" and left location
36c9828f 56 is "file:archives/cpp_doc.zip".
15b6757b
FM
57 There are @b two protocols used in this example: "zip" and "file".
58 @b File Systems Included in wxHTML
59 The following virtual file system handlers are part of wxWidgets so far:
36c9828f
FM
60
61
62
63
64
65
15b6757b 66 @b wxArchiveFSHandler
36c9828f
FM
67
68
69
70
15b6757b
FM
71 A handler for archives such as zip
72 and tar. Include file is wx/fs_arc.h. URLs examples:
73 "archive.zip#zip:filename", "archive.tar.gz#gzip:#tar:filename".
36c9828f
FM
74
75
76
77
78
15b6757b 79 @b wxFilterFSHandler
36c9828f
FM
80
81
82
83
15b6757b
FM
84 A handler for compression schemes such
85 as gzip. Header is wx/fs_filter.h. URLs are in the form, e.g.:
86 "document.ps.gz#gzip:".
36c9828f
FM
87
88
89
90
91
15b6757b 92 @b wxInternetFSHandler
36c9828f
FM
93
94
95
96
15b6757b
FM
97 A handler for accessing documents
98 via HTTP or FTP protocols. Include file is wx/fs_inet.h.
36c9828f
FM
99
100
101
102
103
15b6757b 104 @b wxMemoryFSHandler
36c9828f
FM
105
106
107
108
109 This handler allows you to access
15b6757b
FM
110 data stored in memory (such as bitmaps) as if they were regular files.
111 See @ref memoryfshandler_overview for details.
36c9828f 112 Include file is wx/fs_mem.h. URL is prefixed with memory:, e.g.
15b6757b 113 "memory:myfile.htm"
36c9828f
FM
114
115
116
117
118
15b6757b 119 In addition, wxFileSystem itself can access local files.
36c9828f 120
15b6757b
FM
121 @b Initializing file system handlers
122 Use wxFileSystem::AddHandler to initialize
123 a handler, for example:
36c9828f 124
15b6757b
FM
125 @code
126 #include wx/fs_mem.h
36c9828f 127
15b6757b 128 ...
36c9828f 129
15b6757b
FM
130 bool MyApp::OnInit()
131 {
132 wxFileSystem::AddHandler(new wxMemoryFSHandler);
133 ...
134 }
135 @endcode
36c9828f 136
15b6757b 137 */
36c9828f
FM
138
139