902 lines
21 KiB
HTML
902 lines
21 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Glib::KeyFile</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Glib::KeyFile</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2020-02-18<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Glib::KeyFile - Parser for .ini-like files
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
use Glib;
|
|
|
|
$data .= $_ while (<DATA>);
|
|
|
|
$f = Glib::KeyFile->new;
|
|
$f->load_from_data($data);
|
|
if ($f->has_group('Main') && $f->has_key('Main', 'someotherkey')) {
|
|
$val = $f->get_integer('Main', 'someotherkey');
|
|
print $val . "\n";
|
|
}
|
|
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
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
<B>Glib::KeyFile</B> 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.
|
|
<P>
|
|
|
|
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.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>METHODS</H2>
|
|
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H3>keyfile = Glib::KeyFile-><B>new</B></H3>
|
|
|
|
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H3>boolean = $key_file-><B>get_boolean</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="2">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Retrieves a boolean value from <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbAH"> </A>
|
|
<H3>list = $key_file-><B>get_boolean_list</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="3">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="4">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Retrieves a list of booleans from <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbAI"> </A>
|
|
<H3>$key_file-><B>set_boolean_list</B> ($group_name, $key, ...)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="5">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="6">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="7">•<DD>
|
|
... (list) list of booleans
|
|
</DL>
|
|
<P>
|
|
|
|
Sets a list of booleans in <TT>$key</TT> inside <TT>$group_name</TT>. If <TT>$key</TT> cannot be found
|
|
then it is created. If <TT>$group_name</TT> cannot be found then it is created.
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>$key_file-><B>set_boolean</B> ($group_name, $key, $value)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="8">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="9">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="10">•<DD>
|
|
<TT>$value</TT> (boolean)
|
|
</DL>
|
|
<P>
|
|
|
|
Sets a boolean value to <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
If <TT>$key</TT> is not found, it is created.
|
|
<A NAME="lbAK"> </A>
|
|
<H3>string = $key_file-><B>get_comment</B> ($group_name=undef, $key=undef)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="11">•<DD>
|
|
<TT>$group_name</TT> (string or undef)
|
|
<DT id="12">•<DD>
|
|
<TT>$key</TT> (string or undef)
|
|
</DL>
|
|
<P>
|
|
|
|
Retreives a comment above <TT>$key</TT> from <TT>$group_name</TT>. If <TT>$key</TT> is undef then
|
|
<TT>$comment</TT> will be read from above <TT>$group_name</TT>. If both <TT>$key</TT> and <TT>$group_name</TT>
|
|
are undef, then <TT>$comment</TT> will be read from above the first group in the file.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbAL"> </A>
|
|
<H3>$key_file-><B>set_comment</B> ($group_name, $key, $comment)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="13">•<DD>
|
|
<TT>$group_name</TT> (string or undef)
|
|
<DT id="14">•<DD>
|
|
<TT>$key</TT> (string or undef)
|
|
<DT id="15">•<DD>
|
|
<TT>$comment</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Places a comment above <TT>$key</TT> from <TT>$group_name</TT>. If <TT>$key</TT> is undef then <TT>$comment</TT>
|
|
will be written above <TT>$group_name</TT>. If both <TT>$key</TT> and <TT>$group_name</TT> are undef,
|
|
then <TT>$comment</TT> will be written above the first group in the file.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbAM"> </A>
|
|
<H3>double = $key_file-><B>get_double</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="16">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="17">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Retrieves a double value from <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<P>
|
|
|
|
Since: glib 2.12
|
|
<A NAME="lbAN"> </A>
|
|
<H3>list = $key_file-><B>get_double_list</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="18">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="19">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Retrieves a list of doubles from <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<P>
|
|
|
|
Since: glib 2.12
|
|
<A NAME="lbAO"> </A>
|
|
<H3>$key_file-><B>set_double_list</B> ($group_name, $key, ...)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="20">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="21">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="22">•<DD>
|
|
... (list) list of doubles
|
|
</DL>
|
|
<P>
|
|
|
|
Sets a list of doubles in <TT>$key</TT> inside <TT>$group_name</TT>. If <TT>$key</TT> cannot be found
|
|
then it is created. If <TT>$group_name</TT> cannot be found then it is created.
|
|
<P>
|
|
|
|
Since: glib 2.12
|
|
<A NAME="lbAP"> </A>
|
|
<H3>$key_file-><B>set_double</B> ($group_name, $key, $value)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="23">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="24">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="25">•<DD>
|
|
<TT>$value</TT> (double)
|
|
</DL>
|
|
<P>
|
|
|
|
Sets a double value to <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
If <TT>$key</TT> is not found, it is created.
|
|
<P>
|
|
|
|
Since: glib 2.12
|
|
<A NAME="lbAQ"> </A>
|
|
<H3>list = $key_file-><B>get_groups</B></H3>
|
|
|
|
|
|
|
|
|
|
|
|
Returns the list of groups inside the key_file.
|
|
<A NAME="lbAR"> </A>
|
|
<H3>boolean = $key_file-><B>has_group</B> ($group_name)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="26">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Checks whether <TT>$group_name</TT> is present in <TT>$key_file</TT>.
|
|
<A NAME="lbAS"> </A>
|
|
<H3>boolean = $key_file-><B>has_key</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="27">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="28">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Checks whether <TT>$group_name</TT> has <TT>$key</TT> in it.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbAT"> </A>
|
|
<H3>integer = $key_file-><B>get_integer</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="29">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="30">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Retrieves an integer value from <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbAU"> </A>
|
|
<H3>list = $key_file-><B>get_integer_list</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="31">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="32">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Retrieves a list of integers from <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbAV"> </A>
|
|
<H3>$key_file-><B>set_integer_list</B> ($group_name, $key, ...)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="33">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="34">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="35">•<DD>
|
|
... (list) list of integers
|
|
</DL>
|
|
<P>
|
|
|
|
Sets a list of doubles in <TT>$key</TT> inside <TT>$group_name</TT>. If <TT>$key</TT> cannot be found
|
|
then it is created. If <TT>$group_name</TT> cannot be found then it is created.
|
|
<A NAME="lbAW"> </A>
|
|
<H3>$key_file-><B>set_integer</B> ($group_name, $key, $value)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="36">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="37">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="38">•<DD>
|
|
<TT>$value</TT> (integer)
|
|
</DL>
|
|
<P>
|
|
|
|
Sets an integer value to <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
If <TT>$key</TT> is not found, it is created.
|
|
<A NAME="lbAX"> </A>
|
|
<H3>list = $key_file-><B>get_keys</B> ($group_name)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="39">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Returns the list of keys inside a group of the key file.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbAY"> </A>
|
|
<H3>$key_file-><B>set_list_separator</B> ($separator)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="40">•<DD>
|
|
<TT>$separator</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Sets the list separator character.
|
|
<A NAME="lbAZ"> </A>
|
|
<H3>boolean = $key_file-><B>load_from_data</B> ($buf, $flags)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="41">•<DD>
|
|
<TT>$buf</TT> (scalar)
|
|
<DT id="42">•<DD>
|
|
<TT>$flags</TT> (Glib::KeyFileFlags)
|
|
</DL>
|
|
<P>
|
|
|
|
Parses a string containing a key file structure.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBA"> </A>
|
|
<H3>boolean = $key_file-><B>load_from_data_dirs</B> ($file, $flags)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbBB"> </A>
|
|
<H3>(boolean, scalar) = $key_file-><B>load_from_data_dirs</B> ($file, $flags)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="43">•<DD>
|
|
<TT>$file</TT> (string)
|
|
<DT id="44">•<DD>
|
|
<TT>$flags</TT> (Glib::KeyFileFlags)
|
|
</DL>
|
|
<P>
|
|
|
|
Parses a key file, searching for it inside the data directories.
|
|
In scalar context, it returns a boolean value (true on success, false otherwise);
|
|
in array context, it returns a boolean value and the full path of the file.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBC"> </A>
|
|
<H3>boolean = $key_file-><B>load_from_dirs</B> ($file, $flags, @search_dirs)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbBD"> </A>
|
|
<H3>(boolean, scalar) = $key_file-><B>load_from_dirs</B> ($file, $flags, @search_dirs)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="45">•<DD>
|
|
<TT>$file</TT> (string)
|
|
<DT id="46">•<DD>
|
|
<TT>$flags</TT> (Glib::KeyFileFlags)
|
|
<DT id="47">•<DD>
|
|
... (list)
|
|
</DL>
|
|
<P>
|
|
|
|
Parses a key file, searching for it inside the specified directories.
|
|
In scalar context, it returns a boolean value (true on success, false otherwise);
|
|
in array context, it returns a boolean value and the full path of the file.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<P>
|
|
|
|
Since: glib 2.14
|
|
<A NAME="lbBE"> </A>
|
|
<H3>boolean = $key_file-><B>load_from_file</B> ($file, $flags)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="48">•<DD>
|
|
<TT>$file</TT> (string)
|
|
<DT id="49">•<DD>
|
|
<TT>$flags</TT> (Glib::KeyFileFlags)
|
|
</DL>
|
|
<P>
|
|
|
|
Parses a key file.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBF"> </A>
|
|
<H3>string = $key_file-><B>get_locale_string</B> ($group_name, $key, $locale=undef)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="50">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="51">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="52">•<DD>
|
|
<TT>$locale</TT> (string or undef)
|
|
</DL>
|
|
<P>
|
|
|
|
Returns the value associated with <TT>$key</TT> under <TT>$group_name</TT> translated in the
|
|
given <TT>$locale</TT> if available. If <TT>$locale</TT> is undef then the current locale is
|
|
assumed.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBG"> </A>
|
|
<H3>list = $key_file-><B>get_locale_string_list</B> ($group_name, $key, $locale)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="53">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="54">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="55">•<DD>
|
|
<TT>$locale</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBH"> </A>
|
|
<H3>$key_file-><B>set_locale_string_list</B> ($group_name, $key, $locale, ...)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="56">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="57">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="58">•<DD>
|
|
<TT>$locale</TT> (string)
|
|
<DT id="59">•<DD>
|
|
... (list)
|
|
</DL>
|
|
<P>
|
|
|
|
Associates a list of string values for <TT>$key</TT> and <TT>$locale</TT> under <TT>$group_name</TT>.
|
|
If the translation for <TT>$key</TT> cannot be found then it is created.
|
|
<A NAME="lbBI"> </A>
|
|
<H3>$key_file-><B>set_locale_string</B> ($group_name, $key, $locale, $string)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="60">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="61">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="62">•<DD>
|
|
<TT>$locale</TT> (string)
|
|
<DT id="63">•<DD>
|
|
<TT>$string</TT> (string)
|
|
</DL>
|
|
<A NAME="lbBJ"> </A>
|
|
<H3>$key_file-><B>remove_comment</B> ($group_name=undef, $key=undef)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="64">•<DD>
|
|
<TT>$group_name</TT> (string or undef)
|
|
<DT id="65">•<DD>
|
|
<TT>$key</TT> (string or undef)
|
|
</DL>
|
|
<P>
|
|
|
|
Removes a comment from a group in a key file. If <TT>$key</TT> is undef, the comment
|
|
will be removed from above <TT>$group_name</TT>. If both <TT>$key</TT> and <TT>$group_name</TT> are
|
|
undef, the comment will be removed from the top of the key file.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBK"> </A>
|
|
<H3>$key_file-><B>remove_group</B> ($group_name)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="66">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Removes a group from a key file.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBL"> </A>
|
|
<H3>$key_file-><B>remove_key</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="67">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="68">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Removes a key from <TT>$group_name</TT>.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBM"> </A>
|
|
<H3>string = $key_file-><B>get_start_group</B></H3>
|
|
|
|
|
|
|
|
|
|
|
|
Returns the first group inside a key file.
|
|
<A NAME="lbBN"> </A>
|
|
<H3>string = $key_file-><B>get_string</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="69">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="70">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Retrieves a string value from <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBO"> </A>
|
|
<H3>list = $key_file-><B>get_string_list</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="71">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="72">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Retrieves a list of strings from <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBP"> </A>
|
|
<H3>$key_file-><B>set_string_list</B> ($group_name, $key, ...)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="73">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="74">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="75">•<DD>
|
|
... (list) list of strings
|
|
</DL>
|
|
<P>
|
|
|
|
Sets a list of strings in <TT>$key</TT> inside <TT>$group_name</TT>. The strings will be escaped
|
|
if contain special characters. If <TT>$key</TT> cannot be found then it is created. If
|
|
<TT>$group_name</TT> cannot be found then it is created.
|
|
<A NAME="lbBQ"> </A>
|
|
<H3>$key_file-><B>set_string</B> ($group_name, $key, $value)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="76">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="77">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="78">•<DD>
|
|
<TT>$value</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Sets a string value to <TT>$key</TT> inside <TT>$group_name</TT>. The string will be escaped if
|
|
it contains special characters.
|
|
If <TT>$key</TT> is not found, it is created.
|
|
<A NAME="lbBR"> </A>
|
|
<H3>string = $key_file-><B>to_data</B></H3>
|
|
|
|
|
|
|
|
|
|
|
|
Returns the key file as a string.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBS"> </A>
|
|
<H3>string = $key_file-><B>get_value</B> ($group_name, $key)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="79">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="80">•<DD>
|
|
<TT>$key</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Retrieves the literal value of <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
<P>
|
|
|
|
May croak with a Glib::Error in $@ on failure.
|
|
<A NAME="lbBT"> </A>
|
|
<H3>$key_file-><B>set_value</B> ($group_name, $key, $value)</H3>
|
|
|
|
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="81">•<DD>
|
|
<TT>$group_name</TT> (string)
|
|
<DT id="82">•<DD>
|
|
<TT>$key</TT> (string)
|
|
<DT id="83">•<DD>
|
|
<TT>$value</TT> (string)
|
|
</DL>
|
|
<P>
|
|
|
|
Sets the literal value of <TT>$key</TT> inside <TT>$group_name</TT>.
|
|
If <TT>$key</TT> cannot be found, it is created.
|
|
If <TT>$group_name</TT> cannot be found, it is created.
|
|
<A NAME="lbBU"> </A>
|
|
<H2>ENUMS AND FLAGS</H2>
|
|
|
|
|
|
|
|
<A NAME="lbBV"> </A>
|
|
<H3>flags Glib::KeyFileFlags</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="84">•<DD>
|
|
'none' / 'G_KEY_FILE_NONE'
|
|
<DT id="85">•<DD>
|
|
'keep-comments' / 'G_KEY_FILE_KEEP_COMMENTS'
|
|
<DT id="86">•<DD>
|
|
'keep-translations' / 'G_KEY_FILE_KEEP_TRANSLATIONS'
|
|
</DL>
|
|
<A NAME="lbBW"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
Glib
|
|
<A NAME="lbBX"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright (C) 2003-2011 by the gtk2-perl team.
|
|
<P>
|
|
|
|
This software is licensed under the <FONT SIZE="-1">LGPL.</FONT> See Glib for a full notice.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="87"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="88"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="89"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="90"><A HREF="#lbAE">METHODS</A><DD>
|
|
<DL>
|
|
<DT id="91"><A HREF="#lbAF">keyfile = Glib::KeyFile-><B>new</B></A><DD>
|
|
<DT id="92"><A HREF="#lbAG">boolean = $key_file-><B>get_boolean</B> ($group_name, $key)</A><DD>
|
|
<DT id="93"><A HREF="#lbAH">list = $key_file-><B>get_boolean_list</B> ($group_name, $key)</A><DD>
|
|
<DT id="94"><A HREF="#lbAI">$key_file-><B>set_boolean_list</B> ($group_name, $key, ...)</A><DD>
|
|
<DT id="95"><A HREF="#lbAJ">$key_file-><B>set_boolean</B> ($group_name, $key, $value)</A><DD>
|
|
<DT id="96"><A HREF="#lbAK">string = $key_file-><B>get_comment</B> ($group_name=undef, $key=undef)</A><DD>
|
|
<DT id="97"><A HREF="#lbAL">$key_file-><B>set_comment</B> ($group_name, $key, $comment)</A><DD>
|
|
<DT id="98"><A HREF="#lbAM">double = $key_file-><B>get_double</B> ($group_name, $key)</A><DD>
|
|
<DT id="99"><A HREF="#lbAN">list = $key_file-><B>get_double_list</B> ($group_name, $key)</A><DD>
|
|
<DT id="100"><A HREF="#lbAO">$key_file-><B>set_double_list</B> ($group_name, $key, ...)</A><DD>
|
|
<DT id="101"><A HREF="#lbAP">$key_file-><B>set_double</B> ($group_name, $key, $value)</A><DD>
|
|
<DT id="102"><A HREF="#lbAQ">list = $key_file-><B>get_groups</B></A><DD>
|
|
<DT id="103"><A HREF="#lbAR">boolean = $key_file-><B>has_group</B> ($group_name)</A><DD>
|
|
<DT id="104"><A HREF="#lbAS">boolean = $key_file-><B>has_key</B> ($group_name, $key)</A><DD>
|
|
<DT id="105"><A HREF="#lbAT">integer = $key_file-><B>get_integer</B> ($group_name, $key)</A><DD>
|
|
<DT id="106"><A HREF="#lbAU">list = $key_file-><B>get_integer_list</B> ($group_name, $key)</A><DD>
|
|
<DT id="107"><A HREF="#lbAV">$key_file-><B>set_integer_list</B> ($group_name, $key, ...)</A><DD>
|
|
<DT id="108"><A HREF="#lbAW">$key_file-><B>set_integer</B> ($group_name, $key, $value)</A><DD>
|
|
<DT id="109"><A HREF="#lbAX">list = $key_file-><B>get_keys</B> ($group_name)</A><DD>
|
|
<DT id="110"><A HREF="#lbAY">$key_file-><B>set_list_separator</B> ($separator)</A><DD>
|
|
<DT id="111"><A HREF="#lbAZ">boolean = $key_file-><B>load_from_data</B> ($buf, $flags)</A><DD>
|
|
<DT id="112"><A HREF="#lbBA">boolean = $key_file-><B>load_from_data_dirs</B> ($file, $flags)</A><DD>
|
|
<DT id="113"><A HREF="#lbBB">(boolean, scalar) = $key_file-><B>load_from_data_dirs</B> ($file, $flags)</A><DD>
|
|
<DT id="114"><A HREF="#lbBC">boolean = $key_file-><B>load_from_dirs</B> ($file, $flags, @search_dirs)</A><DD>
|
|
<DT id="115"><A HREF="#lbBD">(boolean, scalar) = $key_file-><B>load_from_dirs</B> ($file, $flags, @search_dirs)</A><DD>
|
|
<DT id="116"><A HREF="#lbBE">boolean = $key_file-><B>load_from_file</B> ($file, $flags)</A><DD>
|
|
<DT id="117"><A HREF="#lbBF">string = $key_file-><B>get_locale_string</B> ($group_name, $key, $locale=undef)</A><DD>
|
|
<DT id="118"><A HREF="#lbBG">list = $key_file-><B>get_locale_string_list</B> ($group_name, $key, $locale)</A><DD>
|
|
<DT id="119"><A HREF="#lbBH">$key_file-><B>set_locale_string_list</B> ($group_name, $key, $locale, ...)</A><DD>
|
|
<DT id="120"><A HREF="#lbBI">$key_file-><B>set_locale_string</B> ($group_name, $key, $locale, $string)</A><DD>
|
|
<DT id="121"><A HREF="#lbBJ">$key_file-><B>remove_comment</B> ($group_name=undef, $key=undef)</A><DD>
|
|
<DT id="122"><A HREF="#lbBK">$key_file-><B>remove_group</B> ($group_name)</A><DD>
|
|
<DT id="123"><A HREF="#lbBL">$key_file-><B>remove_key</B> ($group_name, $key)</A><DD>
|
|
<DT id="124"><A HREF="#lbBM">string = $key_file-><B>get_start_group</B></A><DD>
|
|
<DT id="125"><A HREF="#lbBN">string = $key_file-><B>get_string</B> ($group_name, $key)</A><DD>
|
|
<DT id="126"><A HREF="#lbBO">list = $key_file-><B>get_string_list</B> ($group_name, $key)</A><DD>
|
|
<DT id="127"><A HREF="#lbBP">$key_file-><B>set_string_list</B> ($group_name, $key, ...)</A><DD>
|
|
<DT id="128"><A HREF="#lbBQ">$key_file-><B>set_string</B> ($group_name, $key, $value)</A><DD>
|
|
<DT id="129"><A HREF="#lbBR">string = $key_file-><B>to_data</B></A><DD>
|
|
<DT id="130"><A HREF="#lbBS">string = $key_file-><B>get_value</B> ($group_name, $key)</A><DD>
|
|
<DT id="131"><A HREF="#lbBT">$key_file-><B>set_value</B> ($group_name, $key, $value)</A><DD>
|
|
</DL>
|
|
<DT id="132"><A HREF="#lbBU">ENUMS AND FLAGS</A><DD>
|
|
<DL>
|
|
<DT id="133"><A HREF="#lbBV">flags Glib::KeyFileFlags</A><DD>
|
|
</DL>
|
|
<DT id="134"><A HREF="#lbBW">SEE ALSO</A><DD>
|
|
<DT id="135"><A HREF="#lbBX">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:44 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|