Ruby API docs.
[lms] / www / ruby-api / classes / LightMediaScanner / Scanner.html
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html 
3      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8   <title>Class: LightMediaScanner::Scanner</title>
9   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10   <meta http-equiv="Content-Script-Type" content="text/javascript" />
11   <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12   <script type="text/javascript">
13   // <![CDATA[
14
15   function popupCode( url ) {
16     window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17   }
18
19   function toggleCode( id ) {
20     if ( document.getElementById )
21       elem = document.getElementById( id );
22     else if ( document.all )
23       elem = eval( "document.all." + id );
24     else
25       return false;
26
27     elemStyle = elem.style;
28     
29     if ( elemStyle.display != "block" ) {
30       elemStyle.display = "block"
31     } else {
32       elemStyle.display = "none"
33     }
34
35     return true;
36   }
37   
38   // Make codeblocks hidden by default
39   document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40   
41   // ]]>
42   </script>
43
44 </head>
45 <body>
46
47
48
49     <div id="classHeader">
50         <table class="header-table">
51         <tr class="top-aligned-row">
52           <td><strong>Class</strong></td>
53           <td class="class-name-in-header">LightMediaScanner::Scanner</td>
54         </tr>
55         <tr class="top-aligned-row">
56             <td><strong>In:</strong></td>
57             <td>
58                 <a href="../../files/rdoc_c.html">
59                 rdoc.c
60                 </a>
61         <br />
62             </td>
63         </tr>
64
65         <tr class="top-aligned-row">
66             <td><strong>Parent:</strong></td>
67             <td>
68                 Object
69             </td>
70         </tr>
71         </table>
72     </div>
73   <!-- banner header -->
74
75   <div id="bodyContent">
76
77
78
79   <div id="contextContent">
80
81     <div id="description">
82       <p>
83 <a href="Scanner.html">LightMediaScanner::Scanner</a> is a class to
84 represent a <a href="../LightMediaScanner.html">LightMediaScanner</a>
85 instance.
86 </p>
87
88     </div>
89
90
91    </div>
92
93     <div id="method-list">
94       <h3 class="section-bar">Methods</h3>
95
96       <div class="name-list">
97       <a href="#M000010">add_charset</a>&nbsp;&nbsp;
98       <a href="#M000003">check</a>&nbsp;&nbsp;
99       <a href="#M000008">commit_interval</a>&nbsp;&nbsp;
100       <a href="#M000009">commit_interval=</a>&nbsp;&nbsp;
101       <a href="#M000004">db_path</a>&nbsp;&nbsp;
102       <a href="#M000001">new</a>&nbsp;&nbsp;
103       <a href="#M000002">process</a>&nbsp;&nbsp;
104       <a href="#M000005">processing?</a>&nbsp;&nbsp;
105       <a href="#M000011">remove_charset</a>&nbsp;&nbsp;
106       <a href="#M000006">timeout</a>&nbsp;&nbsp;
107       <a href="#M000007">timeout=</a>&nbsp;&nbsp;
108       </div>
109     </div>
110
111   </div>
112
113
114     <!-- if includes -->
115
116     <div id="section">
117
118
119
120
121
122       
123
124
125     <!-- if method_list -->
126     <div id="methods">
127       <h3 class="section-bar">Public Class methods</h3>
128
129       <div id="method-M000001" class="method-detail">
130         <a name="M000001"></a>
131
132         <div class="method-heading">
133           <a href="Scanner.src/M000001.html" target="Code" class="method-signature"
134             onclick="popupCode('Scanner.src/M000001.html');return false;">
135           <span class="method-name">new</span><span class="method-args">(p1)</span>
136           </a>
137         </div>
138       
139         <div class="method-description">
140           <p>
141 <a href="Scanner.html#M000001">Scanner#new</a>
142 </p>
143 <p>
144 constructor
145 </p>
146 <ul>
147 <li>p1 (<a href="Scanner.html#M000004">db_path</a>) The path to the sqlite3 db
148 to be used
149
150 </li>
151 <li>return A <a href="Scanner.html#M000001">new</a> <a
152 href="Scanner.html">Scanner</a> instance
153
154 </li>
155 </ul>
156         </div>
157       </div>
158
159       <h3 class="section-bar">Public Instance methods</h3>
160
161       <div id="method-M000010" class="method-detail">
162         <a name="M000010"></a>
163
164         <div class="method-heading">
165           <a href="Scanner.src/M000010.html" target="Code" class="method-signature"
166             onclick="popupCode('Scanner.src/M000010.html');return false;">
167           <span class="method-name">add_charset</span><span class="method-args">(p1)</span>
168           </a>
169         </div>
170       
171         <div class="method-description">
172           <p>
173 Scanner::add_charset
174 </p>
175 <p>
176 Register a <a href="Scanner.html#M000001">new</a> charset encoding to be
177 used.
178 </p>
179 <p>
180 Throws a RuntimeError if LMS is unable to add the charset.
181 </p>
182 <ul>
183 <li>p1 (charset) charset name as understood by iconv_open(3).
184
185 </li>
186 <li>return charset
187
188 </li>
189 </ul>
190         </div>
191       </div>
192
193       <div id="method-M000003" class="method-detail">
194         <a name="M000003"></a>
195
196         <div class="method-heading">
197           <a href="Scanner.src/M000003.html" target="Code" class="method-signature"
198             onclick="popupCode('Scanner.src/M000003.html');return false;">
199           <span class="method-name">check</span><span class="method-args">(p1)</span>
200           </a>
201         </div>
202       
203         <div class="method-description">
204           <p>
205 Scanner::check
206 </p>
207 <p>
208 Check consistency of the given directory.
209 </p>
210 <ul>
211 <li>p1 (top_path) The top directory to scan.
212
213 </li>
214 <li>return 0 on success
215
216 </li>
217 </ul>
218         </div>
219       </div>
220
221       <div id="method-M000008" class="method-detail">
222         <a name="M000008"></a>
223
224         <div class="method-heading">
225           <a href="Scanner.src/M000008.html" target="Code" class="method-signature"
226             onclick="popupCode('Scanner.src/M000008.html');return false;">
227           <span class="method-name">commit_interval</span><span class="method-args">()</span>
228           </a>
229         </div>
230       
231         <div class="method-description">
232           <p>
233 Scanner::commit_interval
234 </p>
235 <p>
236 Get the number of files served between database transactions.
237 </p>
238 <ul>
239 <li>return The number of files served between database transactions
240
241 </li>
242 </ul>
243         </div>
244       </div>
245
246       <div id="method-M000009" class="method-detail">
247         <a name="M000009"></a>
248
249         <div class="method-heading">
250           <a href="Scanner.src/M000009.html" target="Code" class="method-signature"
251             onclick="popupCode('Scanner.src/M000009.html');return false;">
252           <span class="method-name">commit_interval=</span><span class="method-args">(p1)</span>
253           </a>
254         </div>
255       
256         <div class="method-description">
257           <p>
258 Scanner::commit_interval=
259 </p>
260 <p>
261 Set the number of files to be served between database transactions.
262 </p>
263 <ul>
264 <li>p1 (transactions) The number of files between commits
265
266 </li>
267 <li>return The <a href="Scanner.html#M000001">new</a> number of files to be
268 served between database transactions
269
270 </li>
271 </ul>
272         </div>
273       </div>
274
275       <div id="method-M000004" class="method-detail">
276         <a name="M000004"></a>
277
278         <div class="method-heading">
279           <a href="Scanner.src/M000004.html" target="Code" class="method-signature"
280             onclick="popupCode('Scanner.src/M000004.html');return false;">
281           <span class="method-name">db_path</span><span class="method-args">()</span>
282           </a>
283         </div>
284       
285         <div class="method-description">
286           <p>
287 Scanner::db_path
288 </p>
289 <p>
290 Accessor for LMS DB path.
291 </p>
292 <ul>
293 <li>return The database path given at creation time
294
295 </li>
296 </ul>
297         </div>
298       </div>
299
300       <div id="method-M000002" class="method-detail">
301         <a name="M000002"></a>
302
303         <div class="method-heading">
304           <a href="Scanner.src/M000002.html" target="Code" class="method-signature"
305             onclick="popupCode('Scanner.src/M000002.html');return false;">
306           <span class="method-name">process</span><span class="method-args">(p1)</span>
307           </a>
308         </div>
309       
310         <div class="method-description">
311           <p>
312 Scanner::process
313 </p>
314 <p>
315 This will add or update media found in the given directory or its children.
316 </p>
317 <ul>
318 <li>p1 (top_path) The top directory to scan.
319
320 </li>
321 <li>return 0 on success
322
323 </li>
324 </ul>
325         </div>
326       </div>
327
328       <div id="method-M000005" class="method-detail">
329         <a name="M000005"></a>
330
331         <div class="method-heading">
332           <a href="Scanner.src/M000005.html" target="Code" class="method-signature"
333             onclick="popupCode('Scanner.src/M000005.html');return false;">
334           <span class="method-name">processing?</span><span class="method-args">()</span>
335           </a>
336         </div>
337       
338         <div class="method-description">
339           <p>
340 Scanner::processing?
341 </p>
342 <p>
343 Checks if Light Media <a href="Scanner.html">Scanner</a> is being used in a
344 processing operation like lms_process() or lms_check().
345 </p>
346 <ul>
347 <li>return Boolean representing the instance&#8216;s processing state
348
349 </li>
350 </ul>
351         </div>
352       </div>
353
354       <div id="method-M000011" class="method-detail">
355         <a name="M000011"></a>
356
357         <div class="method-heading">
358           <a href="Scanner.src/M000011.html" target="Code" class="method-signature"
359             onclick="popupCode('Scanner.src/M000011.html');return false;">
360           <span class="method-name">remove_charset</span><span class="method-args">(p1)</span>
361           </a>
362         </div>
363       
364         <div class="method-description">
365           <p>
366 Scanner::remove_charset
367 </p>
368 <p>
369 Forget about a registered charset encoding.
370 </p>
371 <p>
372 Throws a RuntimeError if LMS is unable to remove the charset.
373 </p>
374 <ul>
375 <li>p1 (charset) charset name as understood by iconv_open(3).
376
377 </li>
378 <li>return charset
379
380 </li>
381 </ul>
382         </div>
383       </div>
384
385       <div id="method-M000006" class="method-detail">
386         <a name="M000006"></a>
387
388         <div class="method-heading">
389           <a href="Scanner.src/M000006.html" target="Code" class="method-signature"
390             onclick="popupCode('Scanner.src/M000006.html');return false;">
391           <span class="method-name">timeout</span><span class="method-args">()</span>
392           </a>
393         </div>
394       
395         <div class="method-description">
396           <p>
397 Scanner::timeout
398 </p>
399 <p>
400 Get the maximum amount of milliseconds the slave can take to serve one
401 file.
402 </p>
403 <p>
404 If a slave takes more than this amount of milliseconds, it will be killed
405 and the scanner will continue with the next file.
406 </p>
407 <ul>
408 <li>return The <a href="Scanner.html#M000006">timeout</a> in milliseconds, or
409 -1 on error
410
411 </li>
412 </ul>
413         </div>
414       </div>
415
416       <div id="method-M000007" class="method-detail">
417         <a name="M000007"></a>
418
419         <div class="method-heading">
420           <a href="Scanner.src/M000007.html" target="Code" class="method-signature"
421             onclick="popupCode('Scanner.src/M000007.html');return false;">
422           <span class="method-name">timeout=</span><span class="method-args">(p1)</span>
423           </a>
424         </div>
425       
426         <div class="method-description">
427           <p>
428 Scanner::timeout=
429 </p>
430 <p>
431 Set the maximum amount of milliseconds the slave can take to serve one
432 file.
433 </p>
434 <p>
435 If a slave takes more than this amount of milliseconds, it will be killed
436 and the scanner will continue with the next file.
437 </p>
438 <ul>
439 <li>p1 (timeout_ms) The <a href="Scanner.html#M000006">timeout</a> in
440 milliseconds
441
442 </li>
443 <li>return The <a href="Scanner.html#M000001">new</a> <a
444 href="Scanner.html#M000006">timeout</a>, in milliseconds
445
446 </li>
447 </ul>
448         </div>
449       </div>
450
451
452     </div>
453
454
455   </div>
456
457
458 <div id="validator-badges">
459   <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
460 </div>
461
462 </body>
463 </html>