/usr/share/doc/lire/dev-manual/ch02s04.html is in lire-devel-doc 2:2.1.1-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Adding a Constructor</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Lire Developer's Manual"><link rel="up" href="ch02.html" title="Chapter 2. Writing a New DLF Converter"><link rel="prev" href="ch02s03.html" title="Creating the DLF Converter Skeleton"><link rel="next" href="ch02s05.html" title="The Meta-Data Methods"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Adding a Constructor</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Writing a New DLF Converter</th><td width="20%" align="right"> <a accesskey="n" href="ch02s05.html">Next</a></td></tr></table><hr></div><div class="section" title="Adding a Constructor"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id402567"></a>Adding a Constructor</h2></div></div></div><p>The <span class="application">Lire</span> framework doesn't place any restrictions on
your DLF converter constructor. In fact, the constructor
isn't used by the framework at all, it will only be used by
your DLF converter registration script (<a class="xref" href="ch02s06.html" title="Registering Your DLF Converter with the Lire Framework">the section called “Registering Your DLF Converter with the <span class="application">Lire</span> Framework”</a>).
</p><p>We will follow perl's convention of using a method named
<code class="methodname">new</code> for our constructor and of
using an hash reference to hold our object's data.
</p><p>Here is our complete constructor:
</p><pre class="programlisting">
use Lire::Syslog;
sub new {
my $pkg = shift;
my $self = bless {}, $pkg;
$self->{syslog_parser} = new Lire::Syslog();
return $self;
}
</pre><p>
Since our log format is based on syslog, we will reuse the
syslog parsing code included in <span class="application">Lire</span>. This is the reason
we instantiate a <code class="classname">Lire::Syslog</code> object
and save a reference to it in our constructor.
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Creating the DLF Converter Skeleton </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> The Meta-Data Methods</td></tr></table></div></body></html>
|