Tizen 2.1 base
[platform/upstream/glib2.0.git] / docs / reference / gio / html / ch01.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Introduction</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="pt01.html" title="Part I. GIO Overview">
9 <link rel="prev" href="pt01.html" title="Part I. GIO Overview">
10 <link rel="next" href="ch02.html" title="Compiling GIO applications">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
16 <td><a accesskey="p" href="pt01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
17 <td><a accesskey="u" href="pt01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
18 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
19 <th width="100%" align="center">GIO Reference Manual</th>
20 <td><a accesskey="n" href="ch02.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
21 </tr></table>
22 <div class="chapter">
23 <div class="titlepage"><div><div><h2 class="title">
24 <a name="id493883"></a>Introduction</h2></div></div></div>
25 <p>
26     GIO is striving to provide a modern, easy-to-use VFS API that sits
27     at the right level in the library stack. The goal is to overcome the
28     shortcomings of GnomeVFS and provide an API that is so good that
29     developers prefer it over raw POSIX calls. Among other things
30     that means using GObject. It also means not cloning the POSIX
31     API, but providing higher-level, document-centric interfaces.
32   </p>
33 <p>
34     The abstract file system model of GIO consists of a number of
35     interfaces and base classes for I/O and files:
36     </p>
37 <div class="variablelist"><table border="0">
38 <col align="left" valign="top">
39 <tbody>
40 <tr>
41 <td><p><span class="term">GFile</span></p></td>
42 <td><p>reference to a file</p></td>
43 </tr>
44 <tr>
45 <td><p><span class="term">GFileInfo</span></p></td>
46 <td><p>information about a file or filesystem</p></td>
47 </tr>
48 <tr>
49 <td><p><span class="term">GFileEnumerator</span></p></td>
50 <td><p>list files in directories</p></td>
51 </tr>
52 <tr>
53 <td><p><span class="term">GDrive</span></p></td>
54 <td><p>represents a drive</p></td>
55 </tr>
56 <tr>
57 <td><p><span class="term">GVolume</span></p></td>
58 <td><p>represents a file system in an abstract way</p></td>
59 </tr>
60 <tr>
61 <td><p><span class="term">GMount</span></p></td>
62 <td><p>represents a mounted file system</p></td>
63 </tr>
64 </tbody>
65 </table></div>
66 <p>
67     Then there is a number of stream classes, similar to the input and
68     output stream hierarchies that can be found in frameworks like Java:
69     </p>
70 <div class="variablelist"><table border="0">
71 <col align="left" valign="top">
72 <tbody>
73 <tr>
74 <td><p><span class="term">GInputStream</span></p></td>
75 <td><p>read data</p></td>
76 </tr>
77 <tr>
78 <td><p><span class="term">GOutputStream</span></p></td>
79 <td><p>write data</p></td>
80 </tr>
81 <tr>
82 <td><p><span class="term">GIOStream</span></p></td>
83 <td><p>read and write data</p></td>
84 </tr>
85 <tr>
86 <td><p><span class="term">GSeekable</span></p></td>
87 <td><p>interface optionally implemented by streams to support seeking</p></td>
88 </tr>
89 </tbody>
90 </table></div>
91 <p>
92     There are interfaces related to applications and the types
93     of files they handle:
94     </p>
95 <div class="variablelist"><table border="0">
96 <col align="left" valign="top">
97 <tbody>
98 <tr>
99 <td><p><span class="term">GAppInfo</span></p></td>
100 <td><p>information about an installed application</p></td>
101 </tr>
102 <tr>
103 <td><p><span class="term">GIcon</span></p></td>
104 <td><p>abstract type for file and application icons</p></td>
105 </tr>
106 </tbody>
107 </table></div>
108 <p>
109     There is a framework for storing and retrieving application settings:
110     </p>
111 <div class="variablelist"><table border="0">
112 <col align="left" valign="top">
113 <tbody><tr>
114 <td><p><span class="term">GSettings</span></p></td>
115 <td><p>stores and retrieves application settings</p></td>
116 </tr></tbody>
117 </table></div>
118 <p>
119     There is support for network programming, including connectivity monitoring,
120     name resolution, lowlevel socket APIs and highlevel client and server
121     helper classes:
122     </p>
123 <div class="variablelist"><table border="0">
124 <col align="left" valign="top">
125 <tbody>
126 <tr>
127 <td><p><span class="term">GSocket</span></p></td>
128 <td><p>lowlevel platform independent socket object</p></td>
129 </tr>
130 <tr>
131 <td><p><span class="term">GResolver</span></p></td>
132 <td><p>asynchronous and cancellable DNS resolver</p></td>
133 </tr>
134 <tr>
135 <td><p><span class="term">GSocketClient</span></p></td>
136 <td><p>high-level network client helper</p></td>
137 </tr>
138 <tr>
139 <td><p><span class="term">GSocketService</span></p></td>
140 <td><p>high-level network server helper</p></td>
141 </tr>
142 <tr>
143 <td><p><span class="term">GSocketConnection</span></p></td>
144 <td><p>network connection stream</p></td>
145 </tr>
146 <tr>
147 <td><p><span class="term">GNetworkMonitor</span></p></td>
148 <td><p>network connectivity monitoring</p></td>
149 </tr>
150 </tbody>
151 </table></div>
152 <p>
153     There is support for connecting to D-Bus,
154     sending and receiving messages, owning and watching bus names,
155     and making objects available on the bus:
156     </p>
157 <div class="variablelist"><table border="0">
158 <col align="left" valign="top">
159 <tbody>
160 <tr>
161 <td><p><span class="term">GDBusConnection</span></p></td>
162 <td><p>a D-Bus connection</p></td>
163 </tr>
164 <tr>
165 <td><p><span class="term">GDBusMethodInvocation</span></p></td>
166 <td><p>for handling remove calls</p></td>
167 </tr>
168 <tr>
169 <td><p><span class="term">GDBusServer</span></p></td>
170 <td><p>helper for accepting connections</p></td>
171 </tr>
172 <tr>
173 <td><p><span class="term">GDBusProxy</span></p></td>
174 <td><p>proxy to access D-Bus interfaces on a remote object</p></td>
175 </tr>
176 </tbody>
177 </table></div>
178 <p>
179     Beyond these, GIO provides facilities for file monitoring,
180     asynchronous I/O and filename completion. In addition to the
181     interfaces, GIO provides implementations for the local case.
182     Implementations for various network file systems are provided
183     by the GVFS package as loadable modules.
184   </p>
185 <p>
186     Other design choices which consciously break with the GnomeVFS
187     design are to move backends out-of-process, which minimizes the
188     dependency bloat and makes the whole system more robust. The backends
189     are not included in GIO, but in the separate GVFS package. The GVFS
190     package also contains the GVFS daemon, which spawn further mount
191     daemons for each individual connection.
192   </p>
193 <div class="figure">
194 <a name="gvfs-overview"></a><p class="title"><b>Figure 1. GIO in the GTK+ library stack</b></p>
195 <div class="figure-contents"><div><img src="gvfs-overview.png" alt="GIO in the GTK+ library stack"></div></div>
196 </div>
197 <br class="figure-break"><p>
198     The GIO model of I/O is stateful: if an application establishes e.g.
199     a SFTP connection to a server, it becomes available to all applications
200     in the session; the user does not have to enter his password over
201     and over again.
202   </p>
203 <p>
204     One of the big advantages of putting the VFS in the GLib layer
205     is that GTK+ can directly use it, e.g. in the filechooser.
206   </p>
207 </div>
208 <div class="footer">
209 <hr>
210           Generated by GTK-Doc V1.18</div>
211 </body>
212 </html>