您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ G_DRIVE_GET_IFACE函数代码示例

51自学网 2021-06-01 21:01:07
  C++
这篇教程C++ G_DRIVE_GET_IFACE函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中G_DRIVE_GET_IFACE函数的典型用法代码示例。如果您正苦于以下问题:C++ G_DRIVE_GET_IFACE函数的具体用法?C++ G_DRIVE_GET_IFACE怎么用?C++ G_DRIVE_GET_IFACE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了G_DRIVE_GET_IFACE函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: g_drive_stop

/** * g_drive_stop: * @drive: a #GDrive. * @flags: flags affecting the unmount if required for stopping. * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid *     user interaction. * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL. * @user_data: user data to pass to @callback * * Asynchronously stops a drive. * * When the operation is finished, @callback will be called. * You can then call g_drive_stop_finish() to obtain the * result of the operation. * * Since: 2.22 */voidg_drive_stop (GDrive               *drive,              GMountUnmountFlags    flags,              GMountOperation      *mount_operation,              GCancellable         *cancellable,              GAsyncReadyCallback   callback,              gpointer              user_data){  GDriveIface *iface;  g_return_if_fail (G_IS_DRIVE (drive));  iface = G_DRIVE_GET_IFACE (drive);  if (iface->stop == NULL)    {      g_task_report_new_error (drive, callback, user_data,                               g_drive_start,                               G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,                               _("drive doesn't implement stop"));      return;    }  (* iface->stop) (drive, flags, mount_operation, cancellable, callback, user_data);}
开发者ID:Leon555,项目名称:glib,代码行数:43,


示例2: g_drive_eject_with_operation

/** * g_drive_eject_with_operation: * @drive: a #GDrive. * @flags: flags affecting the unmount if required for eject * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid *     user interaction. * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL. * @user_data: user data passed to @callback. * * Ejects a drive. This is an asynchronous operation, and is * finished by calling g_drive_eject_with_operation_finish() with the @drive * and #GAsyncResult data returned in the @callback. * * Since: 2.22 **/voidg_drive_eject_with_operation (GDrive              *drive,                              GMountUnmountFlags   flags,                              GMountOperation     *mount_operation,                              GCancellable        *cancellable,                              GAsyncReadyCallback  callback,                              gpointer             user_data){  GDriveIface *iface;  g_return_if_fail (G_IS_DRIVE (drive));  iface = G_DRIVE_GET_IFACE (drive);  if (iface->eject == NULL && iface->eject_with_operation == NULL)    {      g_task_report_new_error (drive, callback, user_data,                               g_drive_eject_with_operation,                               G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,                               /* Translators: This is an error                                * message for drive objects that                                * don't implement any of eject or eject_with_operation. */                               _("drive doesn't implement eject or eject_with_operation"));      return;    }  if (iface->eject_with_operation != NULL)    (* iface->eject_with_operation) (drive, flags, mount_operation, cancellable, callback, user_data);  else    (* iface->eject) (drive, flags, cancellable, callback, user_data);}
开发者ID:Leon555,项目名称:glib,代码行数:47,


示例3: g_drive_has_media

/** * g_drive_has_media: * @drive: a #GDrive. *  * Checks if the @drive has media. Note that the OS may not be polling * the drive for media changes; see g_drive_is_media_check_automatic() * for more details. *  * Returns: %TRUE if @drive has media, %FALSE otherwise. **/gbooleang_drive_has_media (GDrive *drive){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);  iface = G_DRIVE_GET_IFACE (drive);  return (* iface->has_media) (drive);}
开发者ID:Leon555,项目名称:glib,代码行数:21,


示例4: g_drive_is_media_removable

/** * g_drive_is_media_removable: * @drive: a #GDrive. *  * Checks if the @drive supports removable media. *  * Returns: %TRUE if @drive supports removable media, %FALSE otherwise. **/gbooleang_drive_is_media_removable (GDrive *drive){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);  iface = G_DRIVE_GET_IFACE (drive);  return (* iface->is_media_removable) (drive);}
开发者ID:Leon555,项目名称:glib,代码行数:19,


示例5: g_drive_is_media_check_automatic

/** * g_drive_is_media_check_automatic: * @drive: a #GDrive. *  * Checks if @drive is capabable of automatically detecting media changes. *  * Returns: %TRUE if the @drive is capabable of automatically detecting  *     media changes, %FALSE otherwise. **/gbooleang_drive_is_media_check_automatic (GDrive *drive){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);  iface = G_DRIVE_GET_IFACE (drive);  return (* iface->is_media_check_automatic) (drive);}
开发者ID:Leon555,项目名称:glib,代码行数:20,


示例6: g_drive_get_volumes

/** * g_drive_get_volumes: * @drive: a #GDrive. *  * Get a list of mountable volumes for @drive. * * The returned list should be freed with g_list_free(), after * its elements have been unreffed with g_object_unref(). *  * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive. **/GList *g_drive_get_volumes (GDrive *drive){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), NULL);  iface = G_DRIVE_GET_IFACE (drive);  return (* iface->get_volumes) (drive);}
开发者ID:Leon555,项目名称:glib,代码行数:22,


示例7: g_drive_get_icon

/** * g_drive_get_icon: * @drive: a #GDrive. *  * Gets the icon for @drive. *  * Returns: (transfer full): #GIcon for the @drive. *    Free the returned object with g_object_unref(). **/GIcon *g_drive_get_icon (GDrive *drive){  GDriveIface *iface;    g_return_val_if_fail (G_IS_DRIVE (drive), NULL);  iface = G_DRIVE_GET_IFACE (drive);  return (* iface->get_icon) (drive);}
开发者ID:Leon555,项目名称:glib,代码行数:20,


示例8: g_drive_is_removable

/** * g_drive_is_removable: * @drive: a #GDrive. * * Checks if the #GDrive and/or its media is considered removable by the user. * See g_drive_is_media_removable(). * * Returns: %TRUE if @drive and/or its media is considered removable, %FALSE otherwise. * * Since: 2.50 **/gbooleang_drive_is_removable (GDrive *drive){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);  iface = G_DRIVE_GET_IFACE (drive);  if (iface->is_removable != NULL)    return iface->is_removable (drive);  return FALSE;}
开发者ID:Leon555,项目名称:glib,代码行数:24,


示例9: g_drive_can_poll_for_media

/** * g_drive_can_poll_for_media: * @drive: a #GDrive. *  * Checks if a drive can be polled for media changes. *  * Returns: %TRUE if the @drive can be polled for media changes, *     %FALSE otherwise. **/gbooleang_drive_can_poll_for_media (GDrive *drive){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);  iface = G_DRIVE_GET_IFACE (drive);  if (iface->poll_for_media == NULL)    return FALSE;  return (* iface->can_poll_for_media) (drive);}
开发者ID:Leon555,项目名称:glib,代码行数:23,


示例10: g_drive_get_sort_key

/** * g_drive_get_sort_key: * @drive: A #GDrive. * * Gets the sort key for @drive, if any. * * Returns: Sorting key for @drive or %NULL if no such key is available. * * Since: 2.32 */const gchar *g_drive_get_sort_key (GDrive  *drive){  const gchar *ret = NULL;  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), NULL);  iface = G_DRIVE_GET_IFACE (drive);  if (iface->get_sort_key != NULL)    ret = iface->get_sort_key (drive);  return ret;}
开发者ID:Leon555,项目名称:glib,代码行数:24,


示例11: g_drive_can_stop

/** * g_drive_can_stop: * @drive: a #GDrive. * * Checks if a drive can be stopped. * * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise. * * Since: 2.22 */gbooleang_drive_can_stop (GDrive *drive){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);  iface = G_DRIVE_GET_IFACE (drive);  if (iface->can_stop == NULL)    return FALSE;  return (* iface->can_stop) (drive);}
开发者ID:Leon555,项目名称:glib,代码行数:24,


示例12: g_drive_get_start_stop_type

/** * g_drive_get_start_stop_type: * @drive: a #GDrive. * * Gets a hint about how a drive can be started/stopped. * * Returns: A value from the #GDriveStartStopType enumeration. * * Since: 2.22 */GDriveStartStopTypeg_drive_get_start_stop_type (GDrive *drive){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);  iface = G_DRIVE_GET_IFACE (drive);  if (iface->get_start_stop_type == NULL)    return G_DRIVE_START_STOP_TYPE_UNKNOWN;  return (* iface->get_start_stop_type) (drive);}
开发者ID:Leon555,项目名称:glib,代码行数:24,


示例13: g_drive_get_identifier

/** * g_drive_get_identifier: * @drive: a #GDrive * @kind: the kind of identifier to return * * Gets the identifier of the given kind for @drive. * * Returns: a newly allocated string containing the *     requested identfier, or %NULL if the #GDrive *     doesn't have this kind of identifier. */char *g_drive_get_identifier (GDrive     *drive,			const char *kind){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), NULL);  g_return_val_if_fail (kind != NULL, NULL);  iface = G_DRIVE_GET_IFACE (drive);  if (iface->get_identifier == NULL)    return NULL;    return (* iface->get_identifier) (drive, kind);}
开发者ID:Leon555,项目名称:glib,代码行数:27,


示例14: g_drive_get_symbolic_icon

/** * g_drive_get_symbolic_icon: * @drive: a #GDrive. *  * Gets the icon for @drive. *  * Returns: (transfer full): symbolic #GIcon for the @drive. *    Free the returned object with g_object_unref(). * * Since: 2.34 **/GIcon *g_drive_get_symbolic_icon (GDrive *drive){  GDriveIface *iface;  GIcon *ret;  g_return_val_if_fail (G_IS_DRIVE (drive), NULL);  iface = G_DRIVE_GET_IFACE (drive);  if (iface->get_symbolic_icon != NULL)    ret = iface->get_symbolic_icon (drive);  else    ret = g_themed_icon_new_with_default_fallbacks ("drive-removable-media-symbolic");  return ret;}
开发者ID:Leon555,项目名称:glib,代码行数:28,


示例15: g_drive_stop_finish

/** * g_drive_stop_finish: * @drive: a #GDrive. * @result: a #GAsyncResult. * @error: a #GError, or %NULL * * Finishes stopping a drive. * * Returns: %TRUE if the drive has been stopped successfully, *     %FALSE otherwise. * * Since: 2.22 */gbooleang_drive_stop_finish (GDrive        *drive,                     GAsyncResult  *result,                     GError       **error){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);  g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);  if (g_async_result_legacy_propagate_error (result, error))    return FALSE;  else if (g_async_result_is_tagged (result, g_drive_start))    return g_task_propagate_boolean (G_TASK (result), error);  iface = G_DRIVE_GET_IFACE (drive);  return (* iface->stop_finish) (drive, result, error);}
开发者ID:Leon555,项目名称:glib,代码行数:32,


示例16: g_drive_stop_finish

/** * g_drive_stop_finish: * @drive: a #GDrive. * @result: a #GAsyncResult. * @error: a #GError, or %NULL * * Finishes stopping a drive. * * Returns: %TRUE if the drive has been stopped successfully, *     %FALSE otherwise. * * Since: 2.22 */gbooleang_drive_stop_finish (GDrive        *drive,                     GAsyncResult  *result,                     GError       **error){  GDriveIface *iface;  g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);  g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);  if (G_IS_SIMPLE_ASYNC_RESULT (result))    {      GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);      if (g_simple_async_result_propagate_error (simple, error))	return FALSE;    }  iface = G_DRIVE_GET_IFACE (drive);  return (* iface->stop_finish) (drive, result, error);}
开发者ID:antono,项目名称:glib,代码行数:34,


示例17: g_drive_poll_for_media

/** * g_drive_poll_for_media: * @drive: a #GDrive. * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL. * @user_data: user data to pass to @callback *  * Asynchronously polls @drive to see if media has been inserted or removed. *  * When the operation is finished, @callback will be called. * You can then call g_drive_poll_for_media_finish() to obtain the * result of the operation. **/voidg_drive_poll_for_media (GDrive              *drive,                        GCancellable        *cancellable,                        GAsyncReadyCallback  callback,                        gpointer             user_data){  GDriveIface *iface;  g_return_if_fail (G_IS_DRIVE (drive));  iface = G_DRIVE_GET_IFACE (drive);  if (iface->poll_for_media == NULL)    {      g_task_report_new_error (drive, callback, user_data,                               g_drive_poll_for_media,                               G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,                               _("drive doesn't implement polling for media"));      return;    }    (* iface->poll_for_media) (drive, cancellable, callback, user_data);}
开发者ID:Leon555,项目名称:glib,代码行数:36,


示例18: g_drive_start

/** * g_drive_start: * @drive: a #GDrive. * @flags: flags affecting the start operation. * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid *     user interaction. * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL. * @user_data: user data to pass to @callback * * Asynchronously starts a drive. * * When the operation is finished, @callback will be called. * You can then call g_drive_start_finish() to obtain the * result of the operation. * * Since: 2.22 */voidg_drive_start (GDrive              *drive,               GDriveStartFlags     flags,               GMountOperation     *mount_operation,               GCancellable        *cancellable,               GAsyncReadyCallback  callback,               gpointer             user_data){  GDriveIface *iface;  g_return_if_fail (G_IS_DRIVE (drive));  iface = G_DRIVE_GET_IFACE (drive);  if (iface->start == NULL)    {      g_simple_async_report_error_in_idle (G_OBJECT (drive), callback, user_data,					   G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,					   _("drive doesn't implement start"));      return;    }  (* iface->start) (drive, flags, mount_operation, cancellable, callback, user_data);}
开发者ID:antono,项目名称:glib,代码行数:42,



注:本文中的G_DRIVE_GET_IFACE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ G_Damage函数代码示例
C++ G_DEF_SETTERS函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。