gfileinputstream.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2006-2007 Red Hat, Inc.
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  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 2.1 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. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General
  18. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  19. *
  20. * Author: Alexander Larsson <alexl@redhat.com>
  21. */
  22. #ifndef __G_FILE_INPUT_STREAM_H__
  23. #define __G_FILE_INPUT_STREAM_H__
  24. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  25. #error "Only <gio/gio.h> can be included directly."
  26. #endif
  27. #include <gio/ginputstream.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_FILE_INPUT_STREAM (g_file_input_stream_get_type ())
  30. #define G_FILE_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INPUT_STREAM, GFileInputStream))
  31. #define G_FILE_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INPUT_STREAM, GFileInputStreamClass))
  32. #define G_IS_FILE_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INPUT_STREAM))
  33. #define G_IS_FILE_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INPUT_STREAM))
  34. #define G_FILE_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INPUT_STREAM, GFileInputStreamClass))
  35. typedef struct _GFileInputStreamClass GFileInputStreamClass;
  36. typedef struct _GFileInputStreamPrivate GFileInputStreamPrivate;
  37. struct _GFileInputStream
  38. {
  39. GInputStream parent_instance;
  40. /*< private >*/
  41. GFileInputStreamPrivate *priv;
  42. };
  43. struct _GFileInputStreamClass
  44. {
  45. GInputStreamClass parent_class;
  46. goffset (* tell) (GFileInputStream *stream);
  47. gboolean (* can_seek) (GFileInputStream *stream);
  48. gboolean (* seek) (GFileInputStream *stream,
  49. goffset offset,
  50. GSeekType type,
  51. GCancellable *cancellable,
  52. GError **error);
  53. GFileInfo * (* query_info) (GFileInputStream *stream,
  54. const char *attributes,
  55. GCancellable *cancellable,
  56. GError **error);
  57. void (* query_info_async) (GFileInputStream *stream,
  58. const char *attributes,
  59. int io_priority,
  60. GCancellable *cancellable,
  61. GAsyncReadyCallback callback,
  62. gpointer user_data);
  63. GFileInfo * (* query_info_finish) (GFileInputStream *stream,
  64. GAsyncResult *result,
  65. GError **error);
  66. /*< private >*/
  67. /* Padding for future expansion */
  68. void (*_g_reserved1) (void);
  69. void (*_g_reserved2) (void);
  70. void (*_g_reserved3) (void);
  71. void (*_g_reserved4) (void);
  72. void (*_g_reserved5) (void);
  73. };
  74. GIO_AVAILABLE_IN_ALL
  75. GType g_file_input_stream_get_type (void) G_GNUC_CONST;
  76. GIO_AVAILABLE_IN_ALL
  77. GFileInfo *g_file_input_stream_query_info (GFileInputStream *stream,
  78. const char *attributes,
  79. GCancellable *cancellable,
  80. GError **error);
  81. GIO_AVAILABLE_IN_ALL
  82. void g_file_input_stream_query_info_async (GFileInputStream *stream,
  83. const char *attributes,
  84. int io_priority,
  85. GCancellable *cancellable,
  86. GAsyncReadyCallback callback,
  87. gpointer user_data);
  88. GIO_AVAILABLE_IN_ALL
  89. GFileInfo *g_file_input_stream_query_info_finish (GFileInputStream *stream,
  90. GAsyncResult *result,
  91. GError **error);
  92. G_END_DECLS
  93. #endif /* __G_FILE_FILE_INPUT_STREAM_H__ */