RogersMine
view release on metacpan or search on metacpan
local/man/man3/Glib::KeyFile.3pm view on Meta::CPAN
.\" 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 "Glib::KeyFile 3"
.TH Glib::KeyFile 3 "2019-03-03" "perl v5.28.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"
Glib::KeyFile \- Parser for .ini\-like files
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& use Glib;
\&
\& $data .= $_ while (<DATA>);
\&
\& $f = Glib::KeyFile\->new;
\& $f\->load_from_data($data);
\& if ($f\->has_group(\*(AqMain\*(Aq) && $f\->has_key(\*(AqMain\*(Aq, \*(Aqsomeotherkey\*(Aq)) {
\& $val = $f\->get_integer(\*(AqMain\*(Aq, \*(Aqsomeotherkey\*(Aq);
\& print $val . "\en";
\& }
\& 0;
\& _\|_DATA_\|_
\& # a comment
\& [MainSection]
\& somekey=somevalue
\& someotherkey=42
\& someboolkey=true
\& listkey=1;1;2;3;5;8;13;21
\& localekey=Good Morning
\& localekey[it]=Buon giorno
\& localekey[es]=Buenas dias
\& localekey[fr]=Bonjour
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBGlib::KeyFile\fR lets you parse, edit or create files containing groups of
key-value pairs, which we call key files for lack of a better name. Several
freedesktop.org specifications use key files now, e.g the Desktop Entry
Specification and the Icon Theme Specification.
.PP
The syntax of key files is described in detail in the Desktop Entry
Specification, here is a quick summary: Key files consists of groups of
key-value pairs, interspersed with comments.
.SH "METHODS"
.IX Header "METHODS"
.SS "keyfile = Glib::KeyFile\->\fBnew\fP"
.IX Subsection "keyfile = Glib::KeyFile->new"
.ie n .SS "boolean = $key_file\->\fBget_boolean\fP ($group_name, $key)"
.el .SS "boolean = \f(CW$key_file\fP\->\fBget_boolean\fP ($group_name, \f(CW$key\fP)"
.IX Subsection "boolean = $key_file->get_boolean ($group_name, $key)"
.IP "\(bu" 4
\&\f(CW$group_name\fR (string)
.IP "\(bu" 4
\&\f(CW$key\fR (string)
.PP
Retrieves a boolean value from \f(CW$key\fR inside \f(CW$group_name\fR.
.PP
May croak with a Glib::Error in $@ on failure.
.ie n .SS "list = $key_file\->\fBget_boolean_list\fP ($group_name, $key)"
.el .SS "list = \f(CW$key_file\fP\->\fBget_boolean_list\fP ($group_name, \f(CW$key\fP)"
.IX Subsection "list = $key_file->get_boolean_list ($group_name, $key)"
.IP "\(bu" 4
\&\f(CW$group_name\fR (string)
.IP "\(bu" 4
\&\f(CW$key\fR (string)
.PP
Retrieves a list of booleans from \f(CW$key\fR inside \f(CW$group_name\fR.
.PP
May croak with a Glib::Error in $@ on failure.
.ie n .SS "$key_file\->\fBset_boolean_list\fP ($group_name, $key, ...)"
.el .SS "\f(CW$key_file\fP\->\fBset_boolean_list\fP ($group_name, \f(CW$key\fP, ...)"
.IX Subsection "$key_file->set_boolean_list ($group_name, $key, ...)"
.IP "\(bu" 4
\&\f(CW$group_name\fR (string)
.IP "\(bu" 4
\&\f(CW$key\fR (string)
.IP "\(bu" 4
\&... (list) list of booleans
.PP
Sets a list of booleans in \f(CW$key\fR inside \f(CW$group_name\fR. If \f(CW$key\fR cannot be found
then it is created. If \f(CW$group_name\fR cannot be found then it is created.
.ie n .SS "$key_file\->\fBset_boolean\fP ($group_name, $key, $value)"
.el .SS "\f(CW$key_file\fP\->\fBset_boolean\fP ($group_name, \f(CW$key\fP, \f(CW$value\fP)"
.IX Subsection "$key_file->set_boolean ($group_name, $key, $value)"
.IP "\(bu" 4
\&\f(CW$group_name\fR (string)
.IP "\(bu" 4
\&\f(CW$key\fR (string)
.IP "\(bu" 4
\&\f(CW$value\fR (boolean)
.PP
Sets a boolean value to \f(CW$key\fR inside \f(CW$group_name\fR.
If \f(CW$key\fR is not found, it is created.
.ie n .SS "string = $key_file\->\fBget_comment\fP ($group_name=undef, $key=undef)"
.el .SS "string = \f(CW$key_file\fP\->\fBget_comment\fP ($group_name=undef, \f(CW$key\fP=undef)"
.IX Subsection "string = $key_file->get_comment ($group_name=undef, $key=undef)"
.IP "\(bu" 4
\&\f(CW$group_name\fR (string or undef)
( run in 2.211 seconds using v1.01-cache-2.11-cpan-5837b0d9d2c )