Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > a918147e816a04e85f8654f72077e879 > files > 98

perl-Libconf-0.42.10-6.mga4.x86_64.rpm

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">



<ul id="index">
  <li><a href="#NAME">NAME</a></li>
  <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="#CONSTRUCTOR">CONSTRUCTOR</a></li>
  <li><a href="#GENERAL-METHODS">GENERAL METHODS</a></li>
  <li><a href="#SPECIFIC-METHODS">SPECIFIC METHODS</a></li>
</ul>

<h1 id="NAME">NAME</h1>

<p>Libconf::Templates::Generic::Sections - Libconf generic low level template for semantic association (SECTION) rules</p>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>Libconf::Templates::Generic::Sections is a generic template that handles config files that contain semantic informations of type : (SECTION).</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code> $template = new Libconf::Templates::Generic::Section({
                                               section_regexp =&gt; &#39;^\s*\[([^\]]+)\]\s*$&#39;,
                                               section_output_function =&gt; sub { &quot;[$_-&gt;[0]]&quot; },
                                               has_endsection =&gt; 0,
                                               endsection_regexp =&gt; &#39;&#39;,
                                               endsection_output_function =&gt; &#39;&#39;,
                                               comments_struct =&gt; [[&#39;#&#39;]],
                                              });
 $template-&gt;read_conf();
 ...
 (see L&lt;Libconf::Templates&gt; for transformation methods on $template) ...
 ...
 $template-&gt;write_conf(&quot;output_file&quot;);</code></pre>

<h1 id="CONSTRUCTOR">CONSTRUCTOR</h1>

<dl>

<dt id="new-options"><b>new($options)</b></dt>
<dd>

<p>creates the template</p>

<pre><code>  $template = new Libconf::Templates::Generic::Section({
                                                         section_regexp =&gt; &#39;^\s*\[([^\]]+)\]\s*$&#39;,
                                                         section_output_function =&gt; sub { &quot;[$_-&gt;[0]]&quot; },
                                                         has_endsection =&gt; 0,
                                                         endsection_regexp =&gt; &#39;&#39;,
                                                         endsection_output_function =&gt; &#39;&#39;,
                                                         comments_struct =&gt; [[&#39;#&#39;]],
                                                       });</code></pre>

<p><b>arguments</b></p>

<p>$options [<b>type</b> : HASH_REF] specifies the options to create the new template instance.</p>

<p><b>options</b></p>

<p>section_regexp [<b>type</b> : STRING, <b>default</b> : &#39;^\s*\[([^\]]+)\]\s*$&#39;] : the regexp that is applied to determine if a line is a section start. $1 has to be the section name.</p>

<p>section_output_function [<b>type</b> : FUNCTION_REF, <b>default</b> : sub { &quot;[$_-&gt;[0]]&quot; } ] : the code to be applied to a section atom, to generate the line to output. It takes in arguments the name of the section, the atom structure, and $parser_env, the parser environment variable. It should return the line to be written</p>

<p>has_endsection [<b>type</b> : BOOLEAN, <b>default</b> : 1] : if true, section have both start and end tag. If false, a section is considered to end where another section begins, or at the end of the file</p>

<p>endsection_output_function [<b>type</b> : FUNCTION_REF, <b>default</b> : sub { &#39;&#39; } ] : the code to be applied to a section atom, to generate the end section line to output. It takes in arguments the name of the section, the atom structure, and $parser_env, the parser environment variable. It should return the line to be written</p>

<p>endsection_regexp [<b>type</b> : STRING, <b>default</b> : &#39;&#39;] : the regexp that is applied to determine if a line is a end of a section.</p>

<p>comments_struct [<b>type</b> : ARRAY_REF of ARRAY_REF of STRING,STRING,SCALAR, <b>default</b> : [[&#39;#&#39;]] ] : defines the type and the characters of comments. See <a>Libconf::Templates::Keyvalue</a> for additional details on it</p>

</dd>
</dl>

<h1 id="GENERAL-METHODS">GENERAL METHODS</h1>

<p>See <a>Libconf::Templates</a> for the general list of methods you can call on this template.</p>

<h1 id="SPECIFIC-METHODS">SPECIFIC METHODS</h1>

<p>There is no specific method</p>


</body>

</html>