### Struct

# Gimp ConfigWriter

#### Description [src]

    struct GimpConfigWriter {
      /* No available fields */
    }

Functions for writing config info to a file for libgimpconfig.

#### Constructors

###### gimp_config_writer_new_from_fd

No description available.

Available since: 2.4

###### gimp_config_writer_new_from_file

Creates a new `GimpConfigWriter` and sets it up to write to `file`. If `atomic` is `TRUE`, a temporary file is used to avoid possible race conditions. The temporary file is then moved to `file` when the writer is closed.

Available since: 2.10

###### gimp_config_writer_new_from_stream

Creates a new `GimpConfigWriter` and sets it up to write to `output`.

Available since: 2.10

###### gimp_config_writer_new_from_string

No description available.

Available since: 2.4

#### Instance methods

###### gimp_config_writer_close

Closes an element opened with gimp_config_writer_open().

Available since: 2.4

###### gimp_config_writer_comment

Appends the `comment` to `str` and inserts linebreaks and hash-marks to format it as a comment. Note that this function does not handle non-ASCII characters.

Available since: 2.4

###### gimp_config_writer_comment_mode

This function toggles whether the `writer` should create commented or uncommented output. This feature is used to generate the system-wide installed gimprc that documents the default settings.

Available since: 2.4

###### gimp_config_writer_data

No description available.

Available since: 2.4

###### gimp_config_writer_finish

This function finishes the work of `writer` and unrefs it afterwards. It closes all open elements, appends an optional comment and releases all resources allocated by `writer`.

Available since: 2.4

###### gimp_config_writer_identifier

Writes an identifier to `writer`. The `string` is not quoted and special characters are not escaped.

Available since: 2.4

###### gimp_config_writer_linefeed

No description available.

###### gimp_config_writer_open

This function writes the opening parenthesis followed by `name`. It also increases the indentation level and sets a mark that can be used by gimp_config_writer_revert().

Available since: 2.4

###### gimp_config_writer_print

Appends a space followed by `string` to the `writer`. Note that string must not contain any special characters that might need to be escaped.

Available since: 2.4

###### gimp_config_writer_printf

A printf-like function for `GimpConfigWriter`.

Available since: 2.4

###### gimp_config_writer_ref

Adds a reference to a `GimpConfigWriter`.

Available since: 3.0

###### gimp_config_writer_revert

Reverts all changes to `writer` that were done since the last call to gimp_config_writer_open(). This can only work if you didn’t call `gimp_config_writer_close()` yet.

Available since: 2.4

###### gimp_config_writer_string

Writes a string value to `writer`. The `string` is quoted and special characters are escaped.

Available since: 2.4

###### gimp_config_writer_unref

Unref a `GimpConfigWriter`. If the reference count drops to zero, the writer is freed.

Available since: 3.0