gfileenumerator.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2006-2007 Red Hat, Inc.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General
  16. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Author: Alexander Larsson <[email protected]>
  19. */
  20. #ifndef __G_FILE_ENUMERATOR_H__
  21. #define __G_FILE_ENUMERATOR_H__
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #include <gio/giotypes.h>
  26. G_BEGIN_DECLS
  27. #define G_TYPE_FILE_ENUMERATOR (g_file_enumerator_get_type ())
  28. #define G_FILE_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_ENUMERATOR, GFileEnumerator))
  29. #define G_FILE_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_ENUMERATOR, GFileEnumeratorClass))
  30. #define G_IS_FILE_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_ENUMERATOR))
  31. #define G_IS_FILE_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_ENUMERATOR))
  32. #define G_FILE_ENUMERATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_ENUMERATOR, GFileEnumeratorClass))
  33. /**
  34. * GFileEnumerator:
  35. *
  36. * A per matched file iterator.
  37. **/
  38. typedef struct _GFileEnumeratorClass GFileEnumeratorClass;
  39. typedef struct _GFileEnumeratorPrivate GFileEnumeratorPrivate;
  40. struct _GFileEnumerator
  41. {
  42. GObject parent_instance;
  43. /*< private >*/
  44. GFileEnumeratorPrivate *priv;
  45. };
  46. struct _GFileEnumeratorClass
  47. {
  48. GObjectClass parent_class;
  49. /* Virtual Table */
  50. GFileInfo * (* next_file) (GFileEnumerator *enumerator,
  51. GCancellable *cancellable,
  52. GError **error);
  53. gboolean (* close_fn) (GFileEnumerator *enumerator,
  54. GCancellable *cancellable,
  55. GError **error);
  56. void (* next_files_async) (GFileEnumerator *enumerator,
  57. int num_files,
  58. int io_priority,
  59. GCancellable *cancellable,
  60. GAsyncReadyCallback callback,
  61. gpointer user_data);
  62. GList * (* next_files_finish) (GFileEnumerator *enumerator,
  63. GAsyncResult *result,
  64. GError **error);
  65. void (* close_async) (GFileEnumerator *enumerator,
  66. int io_priority,
  67. GCancellable *cancellable,
  68. GAsyncReadyCallback callback,
  69. gpointer user_data);
  70. gboolean (* close_finish) (GFileEnumerator *enumerator,
  71. GAsyncResult *result,
  72. GError **error);
  73. /*< private >*/
  74. /* Padding for future expansion */
  75. void (*_g_reserved1) (void);
  76. void (*_g_reserved2) (void);
  77. void (*_g_reserved3) (void);
  78. void (*_g_reserved4) (void);
  79. void (*_g_reserved5) (void);
  80. void (*_g_reserved6) (void);
  81. void (*_g_reserved7) (void);
  82. };
  83. GLIB_AVAILABLE_IN_ALL
  84. GType g_file_enumerator_get_type (void) G_GNUC_CONST;
  85. GLIB_AVAILABLE_IN_ALL
  86. GFileInfo *g_file_enumerator_next_file (GFileEnumerator *enumerator,
  87. GCancellable *cancellable,
  88. GError **error);
  89. GLIB_AVAILABLE_IN_ALL
  90. gboolean g_file_enumerator_close (GFileEnumerator *enumerator,
  91. GCancellable *cancellable,
  92. GError **error);
  93. GLIB_AVAILABLE_IN_ALL
  94. void g_file_enumerator_next_files_async (GFileEnumerator *enumerator,
  95. int num_files,
  96. int io_priority,
  97. GCancellable *cancellable,
  98. GAsyncReadyCallback callback,
  99. gpointer user_data);
  100. GLIB_AVAILABLE_IN_ALL
  101. GList * g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
  102. GAsyncResult *result,
  103. GError **error);
  104. GLIB_AVAILABLE_IN_ALL
  105. void g_file_enumerator_close_async (GFileEnumerator *enumerator,
  106. int io_priority,
  107. GCancellable *cancellable,
  108. GAsyncReadyCallback callback,
  109. gpointer user_data);
  110. GLIB_AVAILABLE_IN_ALL
  111. gboolean g_file_enumerator_close_finish (GFileEnumerator *enumerator,
  112. GAsyncResult *result,
  113. GError **error);
  114. GLIB_AVAILABLE_IN_ALL
  115. gboolean g_file_enumerator_is_closed (GFileEnumerator *enumerator);
  116. GLIB_AVAILABLE_IN_ALL
  117. gboolean g_file_enumerator_has_pending (GFileEnumerator *enumerator);
  118. GLIB_AVAILABLE_IN_ALL
  119. void g_file_enumerator_set_pending (GFileEnumerator *enumerator,
  120. gboolean pending);
  121. GLIB_AVAILABLE_IN_ALL
  122. GFile * g_file_enumerator_get_container (GFileEnumerator *enumerator);
  123. GLIB_AVAILABLE_IN_2_36
  124. GFile * g_file_enumerator_get_child (GFileEnumerator *enumerator,
  125. GFileInfo *info);
  126. G_END_DECLS
  127. #endif /* __G_FILE_ENUMERATOR_H__ */