/* Returns: (transfer full): a #GFileInfo, or NULL on error.  */
GFileInfo* g_file_input_stream_query_info(GFileInputStream *stream, const char *attributes, GCancellable *cancellable, GError **error)
/* Returns: (transfer full): a #GFileInfo, or NULL on error.  */
GFileInfo* g_file_input_stream_query_info(GFileInputStream *stream, const char *attributes, GCancellable *cancellable, GError **error)
{
  GFileInputStreamClass *class;
  GInputStream *input_stream;
  GFileInfo *info;
  g_return_val_if_fail (G_IS_FILE_INPUT_STREAM (stream), NULL);
  input_stream = G_INPUT_STREAM (stream);
  if (!g_input_stream_set_pending (input_stream, error))
    return NULL;
  info = NULL;
  if (cancellable)
    g_cancellable_push_current (cancellable);
  class = G_FILE_INPUT_STREAM_GET_CLASS (stream);
  if (class->query_info)
    info = class->query_info (stream, attributes, cancellable, error);
  else
    g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
                         _("Stream doesn't support query_info"));
  if (cancellable)
    g_cancellable_pop_current (cancellable);
  g_input_stream_clear_pending (input_stream);
  return info;
}