]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/fs.tex
Added wxStaticBitmap::SetIcon()
[wxWidgets.git] / docs / latex / wx / fs.tex
CommitLineData
704a4b75
VS
1\section{File Systems}\label{fs}
2
3The wxHTML library uses {\bf virtual file systems} mechanism
4similar to the one used in Midnight Commander or Dos Navigator or
5FAR or almost any modern file manager. (Do you remember? You can
6press enter on ZIP file and it's content is displayed like it's
7a directory...)
8
9\wxheading{Classes}
10
11Three classes are used in order to provide full VFS:
12
13\begin{itemize}
14\item \helpref{wxFSFile}{wxfsfile} class provides information
15on opened file (name, input stream, mime type and anchor).
16
17\item \helpref{wxFileSystem}{wxfilesystem} class is interface.
18It's main methods are ChangePathTo() and OpenFile(). This class
19is most often used by the end user.
20
21\item \helpref{wxFileSystemHandler}{wxfilesystemhandler} is the core
22if VFS mechanism. You can derive your own handler and pass it to
23wxFileSystem's AddHandler() method. In the new handler you only need to
24overwrite OpenFile() and CanOpen() methods.
25\end{itemize}
26
27\wxheading{Locations}
28
29Locations (aka filenames aka addresses) are constructed from 4 parts:
30
31\begin{itemize}
32\item {\bf protocol} - handler can regonize if it is able to open some
33file by checking it's protocol. Examples are "http", "file" or "ftp"
34
35\item {\bf right location} - is the name of file within the protocol.
36In "http://www.wxwindows.org/index.html" the right location is "//www.wxwindows.org/index.html"
37
38\item {\bf anchor} - anchor is optional and is usually not present.
39In "index.htm\#chapter2" the anchor is "chapter2"
40
41\item {\bf left location} - this is usually empty string.
42It is used by 'local' protocols such as ZIP.
43See Combined Protocols paragraph for details.
44\end{itemize}
45
46\wxheading{Combined Protocols}
47
48Left location pretends protocol in URL string.
49It's not used by global protocols like HTTP but it's used
50by local ones - for example you can see this address:
51
52file:archives/cpp\_doc.zip\#zip:reference/fopen.htm\#syntax
53
54In this example, protocol is "zip", left location is
55"reference/fopen.htm", anchor is "syntax" and right location
56is "file:archives/cpp_doc.zip". It is used by zip handler
57to determine in what file this particular zip VFS is stored.
58
59In fact there are two protocols used in this example : zip and file.
60You can construct even more complicated addresses like this one:
61
62http://www.archives.org/myarchive.zip\#zip:local/docs/cpp/stdio.zip\#zip:index.htm
63
64In this example you access zip VFS stdio.zip stored in another zip (myarchive.zip)
65which is at WWW. Enjoy it :-)
66
67\wxheading{File Systems Included in wxHTML}
68
69\begin{enumerate}
70\item Local files
71\item HTTP protocol
72\item FTP protocol
73\item .ZIP archives
74\end{enumerate}
75