1 <?xml version="1.0" encoding="iso-8859-1"?>
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
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">
15 function popupCode( url ) {
16 window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
19 function toggleCode( id ) {
20 if ( document.getElementById )
21 elem = document.getElementById( id );
22 else if ( document.all )
23 elem = eval( "document.all." + id );
27 elemStyle = elem.style;
29 if ( elemStyle.display != "block" ) {
30 elemStyle.display = "block"
32 elemStyle.display = "none"
38 // Make codeblocks hidden by default
39 document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
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>
55 <tr class="top-aligned-row">
56 <td><strong>In:</strong></td>
58 <a href="../../files/rdoc_c.html">
65 <tr class="top-aligned-row">
66 <td><strong>Parent:</strong></td>
73 <!-- banner header -->
75 <div id="bodyContent">
79 <div id="contextContent">
81 <div id="description">
83 <a href="Scanner.html">LightMediaScanner::Scanner</a> is a class to
84 represent a <a href="../LightMediaScanner.html">LightMediaScanner</a>
93 <div id="method-list">
94 <h3 class="section-bar">Methods</h3>
96 <div class="name-list">
97 <a href="#M000010">add_charset</a>
98 <a href="#M000003">check</a>
99 <a href="#M000008">commit_interval</a>
100 <a href="#M000009">commit_interval=</a>
101 <a href="#M000004">db_path</a>
102 <a href="#M000001">new</a>
103 <a href="#M000002">process</a>
104 <a href="#M000005">processing?</a>
105 <a href="#M000011">remove_charset</a>
106 <a href="#M000006">timeout</a>
107 <a href="#M000007">timeout=</a>
125 <!-- if method_list -->
127 <h3 class="section-bar">Public Class methods</h3>
129 <div id="method-M000001" class="method-detail">
130 <a name="M000001"></a>
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>
139 <div class="method-description">
141 <a href="Scanner.html#M000001">Scanner#new</a>
147 <li>p1 (<a href="Scanner.html#M000004">db_path</a>) The path to the sqlite3 db
151 <li>return A <a href="Scanner.html#M000001">new</a> <a
152 href="Scanner.html">Scanner</a> instance
159 <h3 class="section-bar">Public Instance methods</h3>
161 <div id="method-M000010" class="method-detail">
162 <a name="M000010"></a>
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>
171 <div class="method-description">
176 Register a <a href="Scanner.html#M000001">new</a> charset encoding to be
180 Throws a RuntimeError if LMS is unable to add the charset.
183 <li>p1 (charset) charset name as understood by iconv_open(3).
193 <div id="method-M000003" class="method-detail">
194 <a name="M000003"></a>
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>
203 <div class="method-description">
208 Check consistency of the given directory.
211 <li>p1 (top_path) The top directory to scan.
214 <li>return 0 on success
221 <div id="method-M000008" class="method-detail">
222 <a name="M000008"></a>
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>
231 <div class="method-description">
233 Scanner::commit_interval
236 Get the number of files served between database transactions.
239 <li>return The number of files served between database transactions
246 <div id="method-M000009" class="method-detail">
247 <a name="M000009"></a>
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>
256 <div class="method-description">
258 Scanner::commit_interval=
261 Set the number of files to be served between database transactions.
264 <li>p1 (transactions) The number of files between commits
267 <li>return The <a href="Scanner.html#M000001">new</a> number of files to be
268 served between database transactions
275 <div id="method-M000004" class="method-detail">
276 <a name="M000004"></a>
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>
285 <div class="method-description">
290 Accessor for LMS DB path.
293 <li>return The database path given at creation time
300 <div id="method-M000002" class="method-detail">
301 <a name="M000002"></a>
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>
310 <div class="method-description">
315 This will add or update media found in the given directory or its children.
318 <li>p1 (top_path) The top directory to scan.
321 <li>return 0 on success
328 <div id="method-M000005" class="method-detail">
329 <a name="M000005"></a>
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>
338 <div class="method-description">
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().
347 <li>return Boolean representing the instance‘s processing state
354 <div id="method-M000011" class="method-detail">
355 <a name="M000011"></a>
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>
364 <div class="method-description">
366 Scanner::remove_charset
369 Forget about a registered charset encoding.
372 Throws a RuntimeError if LMS is unable to remove the charset.
375 <li>p1 (charset) charset name as understood by iconv_open(3).
385 <div id="method-M000006" class="method-detail">
386 <a name="M000006"></a>
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>
395 <div class="method-description">
400 Get the maximum amount of milliseconds the slave can take to serve one
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.
408 <li>return The <a href="Scanner.html#M000006">timeout</a> in milliseconds, or
416 <div id="method-M000007" class="method-detail">
417 <a name="M000007"></a>
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>
426 <div class="method-description">
431 Set the maximum amount of milliseconds the slave can take to serve one
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.
439 <li>p1 (timeout_ms) The <a href="Scanner.html#M000006">timeout</a> in
443 <li>return The <a href="Scanner.html#M000001">new</a> <a
444 href="Scanner.html#M000006">timeout</a>, in milliseconds
458 <div id="validator-badges">
459 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>