.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 "Dpkg::Interface::Storable 3perl" .TH Dpkg::Interface::Storable 3perl 2024-01-19 1.22.3 libdpkg-perl .\" 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 Dpkg::Interface::Storable \- common methods related to object serialization .SH DESCRIPTION .IX Header "DESCRIPTION" Dpkg::Interface::Storable is only meant to be used as parent class for other classes. It provides common methods that are all implemented on top of two basic methods \fBparse()\fR and \fBoutput()\fR. .SH "BASE METHODS" .IX Header "BASE METHODS" Those methods must be provided by the class that wish to inherit from Dpkg::Interface::Storable so that the methods provided can work. .ie n .IP "$obj\->parse($fh[, $desc])" 4 .el .IP "\f(CW$obj\fR\->parse($fh[, \f(CW$desc\fR])" 4 .IX Item "$obj->parse($fh[, $desc])" This methods initialize the object with the data stored in the filehandle. \f(CW$desc\fR is optional and is a textual description of the filehandle used in error messages. .ie n .IP "$string = $obj\->output([$fh])" 4 .el .IP "\f(CW$string\fR = \f(CW$obj\fR\->output([$fh])" 4 .IX Item "$string = $obj->output([$fh])" This method returns a string representation of the object in \f(CW$string\fR and it writes the same string to \f(CW$fh\fR (if it's defined). .SH "PROVIDED METHODS" .IX Header "PROVIDED METHODS" .ie n .IP "$obj\->load($filename, %opts)" 4 .el .IP "\f(CW$obj\fR\->load($filename, \f(CW%opts\fR)" 4 .IX Item "$obj->load($filename, %opts)" Initialize the object with the data stored in the file. The file can be compressed, it will be decompressed on the fly by using a Dpkg::Compression::FileHandle object. If \f(CW$opts\fR{compression} is false the decompression support will be disabled. If \f(CW$filename\fR is "\-", then the standard input is read (no compression is allowed in that case). .ie n .IP "$obj\->save($filename, %opts)" 4 .el .IP "\f(CW$obj\fR\->save($filename, \f(CW%opts\fR)" 4 .IX Item "$obj->save($filename, %opts)" Store the object in the file. If the filename ends with a known compression extension, it will be compressed on the fly by using a Dpkg::Compression::FileHandle object. If \f(CW$opts\fR{compression} is false the compression support will be disabled. If \f(CW$filename\fR is "\-", then the standard output is used (data are written uncompressed in that case). .IP """$obj""" 4 .IX Item """$obj""" Return a string representation of the object. .SH CHANGES .IX Header "CHANGES" .SS "Version 1.01 (dpkg 1.19.0)" .IX Subsection "Version 1.01 (dpkg 1.19.0)" New options: The \f(CW$obj\fR\->\fBload()\fR and \f(CW$obj\fR\->\fBsave()\fR methods support a new compression option. .SS "Version 1.00 (dpkg 1.15.6)" .IX Subsection "Version 1.00 (dpkg 1.15.6)" Mark the module as public.