gimpconfigwriter.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* LIBGIMP - The GIMP Library
  2. * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. *
  4. * GimpConfigWriter
  5. * Copyright (C) 2003 Sven Neumann <sven@gimp.org>
  6. *
  7. * This library is free software: you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 3 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library. If not, see
  19. * <https://www.gnu.org/licenses/>.
  20. */
  21. #if !defined (__GIMP_CONFIG_H_INSIDE__) && !defined (GIMP_CONFIG_COMPILATION)
  22. #error "Only <libgimpconfig/gimpconfig.h> can be included directly."
  23. #endif
  24. #ifndef __GIMP_CONFIG_WRITER_H__
  25. #define __GIMP_CONFIG_WRITER_H__
  26. /**
  27. * GIMP_TYPE_CONFIG_WRITER:
  28. *
  29. * The type ID of the "GimpConfigWriter" type which is a boxed type,
  30. * used to write config files.
  31. *
  32. * Since: 3.0
  33. */
  34. #define GIMP_TYPE_CONFIG_WRITER (gimp_config_writer_get_type ())
  35. GType gimp_config_writer_get_type (void) G_GNUC_CONST;
  36. GimpConfigWriter * gimp_config_writer_new_from_file (GFile *file,
  37. gboolean atomic,
  38. const gchar *header,
  39. GError **error);
  40. GimpConfigWriter * gimp_config_writer_new_from_stream (GOutputStream *output,
  41. const gchar *header,
  42. GError **error);
  43. GimpConfigWriter * gimp_config_writer_new_from_fd (gint fd);
  44. GimpConfigWriter * gimp_config_writer_new_from_string (GString *string);
  45. GimpConfigWriter * gimp_config_writer_ref (GimpConfigWriter *writer);
  46. void gimp_config_writer_unref (GimpConfigWriter *writer);
  47. void gimp_config_writer_open (GimpConfigWriter *writer,
  48. const gchar *name);
  49. void gimp_config_writer_comment_mode (GimpConfigWriter *writer,
  50. gboolean enable);
  51. void gimp_config_writer_print (GimpConfigWriter *writer,
  52. const gchar *string,
  53. gint len);
  54. void gimp_config_writer_printf (GimpConfigWriter *writer,
  55. const gchar *format,
  56. ...) G_GNUC_PRINTF (2, 3);
  57. void gimp_config_writer_identifier (GimpConfigWriter *writer,
  58. const gchar *identifier);
  59. void gimp_config_writer_string (GimpConfigWriter *writer,
  60. const gchar *string);
  61. void gimp_config_writer_data (GimpConfigWriter *writer,
  62. gint length,
  63. const guint8 *data);
  64. void gimp_config_writer_comment (GimpConfigWriter *writer,
  65. const gchar *comment);
  66. void gimp_config_writer_linefeed (GimpConfigWriter *writer);
  67. void gimp_config_writer_revert (GimpConfigWriter *writer);
  68. void gimp_config_writer_close (GimpConfigWriter *writer);
  69. gboolean gimp_config_writer_finish (GimpConfigWriter *writer,
  70. const gchar *footer,
  71. GError **error);
  72. #endif /* __GIMP_CONFIG_WRITER_H__ */