.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RoPkg::Rsync::ConfFile 3pm" .TH RoPkg::Rsync::ConfFile 3pm "2021-12-26" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" RoPkg::Rsync::ConfFile .SH "DESCRIPTION" .IX Header "DESCRIPTION" RoPkg::Rsync::ConfFile is a class used to manipulate rsync configuration files. Is capable to maintaine the order of the modules, and even keep your comments and empty lines intact. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& #!/usr/bin/perl \& \& use warnings; \& use strict; \& \& sub main { \& my $cf = new RoPkg::Rsync::ConfFile(filename => \*(Aq/etc/rsyncd.conf\*(Aq); \& \& $cf\->Write(\*(Aq/tmp/new_rsyncd.conf\*(Aq); \& return 0; \& } \& \& main(); .Ve .SH "METHODS" .IX Header "METHODS" All methods, throw the \fIOutsideClass\fR exception, if you use them as class methods. Besides \&\fIOutsideClass\fR the methods are throwing other exceptions as well. Refer to each method documentation for more information. .SS "new(%hash)" .IX Subsection "new(%hash)" The class constructor. Accepts a hash as parameter. At this moment only one parameter can be specified inside the hash: \&\fBfilename\fR . If this parameter is present, the file specified is parsed and loaded into the object. .ie n .SS "AddParam($pname, $pvalue)" .el .SS "AddParam($pname, \f(CW$pvalue\fP)" .IX Subsection "AddParam($pname, $pvalue)" Add a new global parameter named \fB\f(CB$pname\fB\fR with value \fB\f(CB$value\fB\fR. .SS "AddComment($pval)" .IX Subsection "AddComment($pval)" Add a new global comment with value \fB\f(CB$pval\fB\fR .SS "AddBlank($bval)" .IX Subsection "AddBlank($bval)" Add a new global blank line with value \fB\f(CB$bval\fB\fR .SS "AddNode($node)" .IX Subsection "AddNode($node)" Adds a new RoPkg::Rsync::Node object to the current object. Before the node is added, the nodes list is checked for duplicates of the object. If a duplicate is found, the method does nothing. .PP \&\fBExceptions\fR: .PP If \f(CW$node\fR is not a instance of RoPkg::Rsync::Node, \fIParam::Wrong\fR exception is raised. .SS "DelNode($node_name)" .IX Subsection "DelNode($node_name)" Removes a node from the nodes list. The nodes are searched by their names. Returns \-1 if the node was not found, the new number of nodes otherwise. .SS "HasNode($node_name)" .IX Subsection "HasNode($node_name)" Returns 1 if the node with name \fB\f(CB$node_name\fB\fR was found in the nodes list, 0 otherwise. .SS "\fBClean()\fP" .IX Subsection "Clean()" Clean the object. Removes all information (the nodes list, statistics, etc). Always returns 1. .SS "Parse($filename)" .IX Subsection "Parse($filename)" Parse the configuration file \fB\f(CB$filename\fB\fR and returns the number of nodes. If \fB\f(CB$filename\fB\fR is not defined \fIParam::Missing\fR exception is raised. If the path does not point to a existing file, \fIFile::NotFound\fR exception is raised. If the file could not be opened, \fIFile::Open\fR exception is raised. .SS "Write($path)" .IX Subsection "Write($path)" Write the configuration into the file specified by path \fB\f(CB$path\fB\fR. .SS "\fBToString()\fP" .IX Subsection "ToString()" Returns the string representation of the configuration file. .SH "PREREQUISITES" .IX Header "PREREQUISITES" perl 5.008 (or later) is required. Besides perl, you must have the following: .IP "*) RoPkg::Exceptions" 3 .IX Item "*) RoPkg::Exceptions" .PD 0 .IP "*) Scalar::Util" 3 .IX Item "*) Scalar::Util" .IP "*) English" 3 .IX Item "*) English" .PD .SH "SEE ALSO" .IX Header "SEE ALSO" RoPkg::Rsync::Atom RoPkg::Rsync::ConfFile RoPkg::Exceptions .SH "AUTHOR" .IX Header "AUTHOR" Subredu Manuel .SH "LICENSE" .IX Header "LICENSE" Copyright (C) 2005 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The \s-1LICENSE\s0 file contains the full text of the license.