Top |
Functions
GimpConfigWriter * | gimp_config_writer_new_file () |
GimpConfigWriter * | gimp_config_writer_new_gfile () |
GimpConfigWriter * | gimp_config_writer_new_stream () |
GimpConfigWriter * | gimp_config_writer_new_fd () |
GimpConfigWriter * | gimp_config_writer_new_string () |
void | gimp_config_writer_open () |
void | gimp_config_writer_comment_mode () |
void | gimp_config_writer_print () |
void | gimp_config_writer_printf () |
void | gimp_config_writer_identifier () |
void | gimp_config_writer_string () |
void | gimp_config_writer_data () |
void | gimp_config_writer_comment () |
void | gimp_config_writer_linefeed () |
void | gimp_config_writer_revert () |
void | gimp_config_writer_close () |
gboolean | gimp_config_writer_finish () |
Functions
gimp_config_writer_new_file ()
GimpConfigWriter * gimp_config_writer_new_file (const gchar *filename
,gboolean atomic
,const gchar *header
,GError **error
);
Creates a new GimpConfigWriter and sets it up to write to
filename
. If atomic
is TRUE
, a temporary file is used to avoid
possible race conditions. The temporary file is then moved to
filename
when the writer is closed.
Parameters
filename |
a filename |
|
atomic |
if |
|
header |
text to include as comment at the top of the file |
|
error |
return location for errors |
Since: 2.4
gimp_config_writer_new_gfile ()
GimpConfigWriter * gimp_config_writer_new_gfile (GFile *file
,gboolean atomic
,const gchar *header
,GError **error
);
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.
Parameters
file |
a GFile |
|
atomic |
if |
|
header |
text to include as comment at the top of the file |
|
error |
return location for errors |
Since: 2.10
gimp_config_writer_new_stream ()
GimpConfigWriter * gimp_config_writer_new_stream (GOutputStream *output
,const gchar *header
,GError **error
);
Creates a new GimpConfigWriter and sets it up to write to
output
.
Parameters
output |
a GOutputStream |
|
header |
text to include as comment at the top of the file |
|
error |
return location for errors |
Since: 2.10
gimp_config_writer_new_string ()
GimpConfigWriter *
gimp_config_writer_new_string (GString *string
);
Since: 2.4
gimp_config_writer_open ()
void gimp_config_writer_open (GimpConfigWriter *writer
,const gchar *name
);
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()
.
Since: 2.4
gimp_config_writer_comment_mode ()
void gimp_config_writer_comment_mode (GimpConfigWriter *writer
,gboolean enable
);
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.
Since comments have to start at the beginning of a line, this function will insert a newline if necessary.
Since: 2.4
gimp_config_writer_print ()
void gimp_config_writer_print (GimpConfigWriter *writer
,const gchar *string
,gint len
);
Appends a space followed by string
to the writer
. Note that string
must not contain any special characters that might need to be escaped.
Parameters
writer |
||
string |
a string to write |
|
len |
number of bytes from |
Since: 2.4
gimp_config_writer_printf ()
void gimp_config_writer_printf (GimpConfigWriter *writer
,const gchar *format
,...
);
A printf-like function for GimpConfigWriter.
Parameters
writer |
||
format |
a format string as described for |
|
... |
list of arguments according to |
Since: 2.4
gimp_config_writer_identifier ()
void gimp_config_writer_identifier (GimpConfigWriter *writer
,const gchar *identifier
);
Writes an identifier to writer
. The string
is *not* quoted and special
characters are *not* escaped.
Since: 2.4
gimp_config_writer_string ()
void gimp_config_writer_string (GimpConfigWriter *writer
,const gchar *string
);
Writes a string value to writer
. The string
is quoted and special
characters are escaped.
Since: 2.4
gimp_config_writer_data ()
void gimp_config_writer_data (GimpConfigWriter *writer
,gint length
,const guint8 *data
);
Since: 2.4
gimp_config_writer_comment ()
void gimp_config_writer_comment (GimpConfigWriter *writer
,const gchar *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.
Since: 2.4
gimp_config_writer_revert ()
void
gimp_config_writer_revert (GimpConfigWriter *writer
);
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.
Since: 2.4
gimp_config_writer_close ()
void
gimp_config_writer_close (GimpConfigWriter *writer
);
Closes an element opened with gimp_config_writer_open()
.
Since: 2.4
gimp_config_writer_finish ()
gboolean gimp_config_writer_finish (GimpConfigWriter *writer
,const gchar *footer
,GError **error
);
This function finishes the work of writer
and frees it afterwards.
It closes all open elements, appends an optional comment and
releases all resources allocated by writer
. You must not access
the writer
afterwards.
Parameters
writer |
||
footer |
text to include as comment at the bottom of the file |
|
error |
return location for possible errors |
Since: 2.4