.\" 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::Node 3pm" .TH RoPkg::Rsync::Node 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::Node .SH "DESCRIPTION" .IX Header "DESCRIPTION" A node is a rsync module. A node is formed of zero or more atoms. .PP \&\fBExample\fR: .PP .Vb 5 \& [debian] \& path = /var/ftp/pub/mirrors/debian.org/ \&#This comment will show on rsync \-v \& comment = Debian Mirror \& list = yes .Ve .PP [debian] is the node. The node name is \fBdebian\fR. The node has 4 atoms: .IP "*) param atom (path)" 4 .IX Item "*) param atom (path)" .PD 0 .IP "*) comment atom (the comment)" 4 .IX Item "*) comment atom (the comment)" .IP "*) param atom (comment)" 4 .IX Item "*) param atom (comment)" .IP "*) param atom (list)" 4 .IX Item "*) param atom (list)" .PD .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& #!/usr/bin/perl \& \& use strict; \& use warnings; \& \& sub main { \& my $node = new RoPkg::Rsync::Node(node_name => \*(Aqdebian\*(Aq); \& \& $node\->AddParam(\*(Aqpath\*(Aq, \*(Aq/var/ftp/pub/mirrors/debian.org\*(Aq); \& $node\->AddComment(\*(Aq#This comment will show on rsync \-v\*(Aq); \& $node\->AddParam(\*(Aqcomment\*(Aq, \*(AqDebian Mirror\*(Aq); \& $node\->AddParam(\*(Aqlist\*(Aq, \*(Aqyes\*(Aq); \& \& print $node\->ToString(); \& } \& \& main(); .Ve .PP The result is: .PP .Vb 5 \& [debian] \& path = /var/ftp/pub/mirrors/debian.org \& #This comment will show on rsync \-v \& comment = Debian Mirror \& list = yes .Ve .SH "METHODS" .IX Header "METHODS" All methods, throw the OutsideClass 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 constructor of the class. Expects a hash as parameter. At this time, the only valid option is \fBnode_name\fR . Any other option will be discarded. The \fBnode_name\fR is a required parameter. If is not defined, a \fIParam::Missing\fR exception will be raised. .PP \&\fBExample\fR: .PP .Vb 1 \& my $node = new RoPkg::Rsync::Node(node_name => \*(Aqdebian\*(Aq); .Ve .SS "Add(%atom_details)" .IX Subsection "Add(%atom_details)" Add a new atom to the node. The atom details (type, name and value) are keys from the hash. All three parameters must be defined. There are 2 special cases: when the atom is a comment or a blank. In both cases, RoPkg::Rsync::Node generates a name for them. If the atom is a comment or a blank the returned value is the name of the atom. If the atom is a parameter, the total number of atoms for this node is returned. .PP \&\fBExample\fR: .PP .Vb 5 \& $node\->Add( \& type => \*(Aqparam\*(Aq, \& name => \*(Aqpath\*(Aq, \& value => \*(Aq/var/ftp/pub/mirrors/debian.org\*(Aq, \& ); .Ve .PP The returned value is the total number of atoms for this node. .PP \&\fBExample\fR: .PP .Vb 4 \& $node\->Add( \& type => \*(Aqcomment\*(Aq, \& value => \*(Aq#This comment will show on rsync \-v\*(Aq, \& ); .Ve .PP The returned value is the name of the atom (the name is autogenerated). .PP \&\fBExceptions\fR: .ie n .IP "*) Param::Missing \- $atom_details{type} is not defined" 2 .el .IP "*) Param::Missing \- \f(CW$atom_details\fR{type} is not defined" 2 .IX Item "*) Param::Missing - $atom_details{type} is not defined" .PD 0 .ie n .IP "*) Param::Wrong = $atom_details{name} or $atom_details{value} are not defined" 2 .el .IP "*) Param::Wrong = \f(CW$atom_details\fR{name} or \f(CW$atom_details\fR{value} are not defined" 2 .IX Item "*) Param::Wrong = $atom_details{name} or $atom_details{value} are not defined" .PD .ie n .SS "AddParam($pname, $pvalue)" .el .SS "AddParam($pname, \f(CW$pvalue\fP)" .IX Subsection "AddParam($pname, $pvalue)" A wrapper around Add provided for comodity. See \fBAdd\fR documentation for more details about the behaviour. .SS "AddComment($comment_value)" .IX Subsection "AddComment($comment_value)" A wrapper around Add provided for comodity. See \fBAdd\fR documentation for more details about the behaviour. .SS "AddBlank($blank_value)" .IX Subsection "AddBlank($blank_value)" A wrapper around Add provided for comodity. See \fBAdd\fR documentation for more details about the behaviour. .SS "GetAtom(%atom_details)" .IX Subsection "GetAtom(%atom_details)" Returns a RoPkg::Rsync::Atom object based on parameters specified in \f(CW%atom_details\fR. The \f(CW%atom_details\fR fields can be: \fItype\fR, \fIname\fR and \&\fIvalue\fR. \fBtype\fR and \fBvalue\fR \fBmust\fR be specified. .PP \&\fBExceptions\fR: .IP "*) Param::Missing \- type/name were not specified" 2 .IX Item "*) Param::Missing - type/name were not specified" .PD 0 .IP "*) Param::Unknown \- no objects were found" 2 .IX Item "*) Param::Unknown - no objects were found" .PD .PP Take note that only the first object who match the criterias is returned. .SS "GetParam($name)" .IX Subsection "GetParam($name)" A wrapper around GetAtom provided for comodity. See \fBGetAtom\fR documentation for more details about the behaviour. .SS "GetComment($name)" .IX Subsection "GetComment($name)" A wrapper around GetAtom provided for comodity. See \fBGetAtom\fR documentation for more details about the behaviour. .SS "GetBlank($name)" .IX Subsection "GetBlank($name)" A wrapper around GetAtom provided for comodity. See \fBGetAtom\fR documentation for more details about the behaviour. .SS "\fBGetAll()\fP" .IX Subsection "GetAll()" Returns a array with all the atoms of the node. In scalar context returns the number of atoms. .SS "\fBGetAtomsNo()\fP" .IX Subsection "GetAtomsNo()" Returns the number of atoms for this node. .SS "Has($atom)" .IX Subsection "Has($atom)" Returns 1 if the \f(CW$atom\fR object is already a atom for this node, 0 otherwise. .SS "Delete($atom_name)" .IX Subsection "Delete($atom_name)" Removes the atom those name is \fI\f(CI$atom_name\fI\fR. Returns 1 on success (the atom was found and removed), 0 otherwise. .SS "Name($node_name)" .IX Subsection "Name($node_name)" get/set method for node name. Using this method you can change the node name or find it. .ie n .SS "ToString($indent, $include_node_name)" .el .SS "ToString($indent, \f(CW$include_node_name\fP)" .IX Subsection "ToString($indent, $include_node_name)" Returns the string representation of the node. If \fI\f(CI$indent\fI\fR is true, the atoms are indented. If \f(CW$include_node_name\fR is true, the node name will be included in the string. .PP \&\fBExample\fR: .PP .Vb 2 \& $node = new RoPkg::Rsync::Node(node_name => \*(Aqdebian\*(Aq); \& $node\->AddParam(\*(Aqgid\*(Aq, \*(Aqusers\*(Aq); \& \& print $node\->ToString(0, 0),$/, \& $node\->ToString(0, 1),$/, \& $node\->ToString(1, 1),$/, \& $node\->ToString(),$/; .Ve .PP The result is: gid = users [debian] gid = users; [debian] gid = users [debian] gid = users .SH "PREREQUISITES" .IX Header "PREREQUISITES" perl 5.008 (or later) is required. Besides perl, you must have the following: .IP "*) RoPkg::Exceptions" 4 .IX Item "*) RoPkg::Exceptions" .PD 0 .IP "*) Scalar::Util" 4 .IX Item "*) Scalar::Util" .IP "*) English" 4 .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.