Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > d1bd68ea67b363532151ebe62cd98305 > files > 97

perl-Libconf-0.42.10-3.mga1.i586.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>Libconf::Templates::Generic::KeyValues - Libconf generic low level template for semantic association styles config files</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">


<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>

<ul>

	<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>

<hr name="index" />
</div>
<!-- INDEX END -->

<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Libconf::Templates::Generic::KeyValues - Libconf generic low level template for semantic association (KEY - (KEY0 - VALUE0, ... KEYn - VALUEn)) styles config files</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>Libconf::Templates::Generic::KeyValues is a generic template that handles config files that contain semantic informations of type : (KEY - (KEY0 - VALUE0, ... KEYn - VALUEn)).</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
  my $template = new Libconf::Templates::Generic::KeyValues({
                                                             filename =&gt; 'some_file',
                                                             comments_struct =&gt; [['#']],
                                                             regexp =&gt; '^\s*(\S+?):(\S*?):(\S*?):(.*?)\s*$',
                                                             keys_list =&gt; [qw(group_name passwd GID user_list)],
                                                             identifier_key =&gt; 'group_name',
                                                             output_function =&gt; sub { join(':', map { $atom-&gt;{values}{$_} } @_ ) }
                                                           })
 $template-&gt;read_conf();
 ...
 (see L&lt;Libconf::Templates&gt; for transformation methods on $template)
 ...
 $template-&gt;write_conf();</pre>
<p>
</p>
<hr />
<h1><a name="constructor">CONSTRUCTOR</a></h1>
<dl>
<dt><strong><a name="new" class="item"><strong>new($options)</strong></a></strong></dt>

<dd>
<p>creates the template</p>
<pre>
  $template = new Libconf::Templates::Generic::KeyValues({
                                                           filename =&gt; 'some_file',
                                                           comments_struct =&gt; [['#']],
                                                           regexp =&gt; '^\s*(\S+?):(\S*?):(\S*?):(.*?)\s*$',
                                                           keys_list =&gt; [qw(group_name passwd GID user_list)],
                                                           identifier_key =&gt; 'group_name',
                                                           output_function =&gt; sub { join(':', map { $atom-&gt;{values}{$_} } @_ ) }
                                                         })</pre>
<p><strong>arguments</strong></p>
<p>$options [<strong>type</strong> : HASH_REF] specifies the options to create the new template instance.</p>
<p><strong>options</strong></p>
<p>filename [<strong>type</strong> : STRING, <strong>default</strong> : ''] : the filename of the config file
you want to work on. Can be read and written lately by using set_filename and
get_filename.</p>
<p>regexp [<strong>type</strong> : STRING, <strong>default</strong> : ''] : the regexp that is applied to each line</p>
<p>keys_list [<strong>type</strong> : ARRAY_REF, <strong>default</strong> : []] : the list of names of keys
which will receive the regexp matchs</p>
<p>identifier_key [<strong>type</strong> : STRING, <strong>default</strong> : $key_list-&gt;[0] ] : the key that identifies line</p>
<p>comments_struct [<strong>type</strong> : ARRAY_REF of ARRAY_REF of STRING,STRING,SCALAR,
<strong>default</strong> : [['#']] ] : defines the type and the characters of comments. See
<a href="./Libconf/Templates/Keyvalue.html">the Libconf::Templates::Keyvalue manpage</a> for additional details on it</p>
<p>keys_list [<strong>type</strong> : ARRAY_REF, <strong>default</strong> : []] : the list of names of keys
which will receive the regexp matchs</p>
<p>output_function [<strong>type</strong> : FUNCTION_REF, <strong>default</strong> : sub {} ] : the code to be
applied to an atom, to generate the line to output. It takes in arguments the
atom, and the list of keys keys_list : ($atom, @key_list)</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="general_methods">GENERAL METHODS</a></h1>
<p>See <a href="./Libconf/Templates.html">the Libconf::Templates manpage</a> for the general list of methods you can call on this
template.</p>
<p>
</p>
<hr />
<h1><a name="specific_methods">SPECIFIC METHODS</a></h1>
<p>There is no specific methods</p>

</body>

</html>