get_comment


Description:

public string get_comment (string? group_name, string? key) throws KeyFileError

Retrieves a comment above key from group_name.

If key is `NULL` then comment will be read from above group_name. If both key and group_name are `NULL`, then comment will be read from above the first group in the file.

Note that the returned string does not include the `#` comment markers, but does include any whitespace after them (on each line). It includes the line breaks between lines, but does not include the final line break.

Parameters:

this

a key file

group_name

a group name, or `NULL` to get a top-level comment

key

a key, or `NULL` to get a group comment

Returns:

a comment that should be freed with [func@GLib.free]