Method

GLibPathBufset_extension

since: 2.76

Declaration

gboolean
g_path_buf_set_extension (
  GPathBuf* buf,
  const char* extension
)

Description

Adds an extension to the file name in the path buffer.

If extension is NULL, the extension will be unset.

If the path buffer does not have a file name set, this function returns FALSE and leaves the path buffer unmodified.

Available since: 2.76

Parameters

extension

Type: const char*

The file extension.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a file system path, using the OS encoding.

Return value

Type: gboolean

TRUE if the extension was replaced, and FALSE otherwise.