📄 gfile.h
字号:
/* GIO - GLib Input, Output and Streaming Library * * Copyright (C) 2006-2007 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * * Author: Alexander Larsson <alexl@redhat.com> */#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)#error "Only <gio/gio.h> can be included directly."#endif#ifndef __G_FILE_H__#define __G_FILE_H__#include <gio/giotypes.h>G_BEGIN_DECLS#define G_TYPE_FILE (g_file_get_type ())#define G_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_FILE, GFile))#define G_IS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_FILE))#define G_FILE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_FILE, GFileIface))#if 0/** * GFile: * * A handle to an object implementing the #GFileIface interface. * Generally stores a location within the file system. Handles do not * necessarily represent files or directories that currently exist. **/typedef struct _GFile GFile; /* Dummy typedef */#endiftypedef struct _GFileIface GFileIface;/** * GFileIface: * @g_iface: The parent interface. * @dup: Duplicates a #GFile. * @hash: Creates a hash of a #GFile. * @equal: Checks equality of two given #GFile<!-- -->s. * @is_native: Checks to see if a file is native to the system. * @has_uri_scheme: Checks to see if a #GFile has a given URI scheme. * @get_uri_scheme: Gets the URI scheme for a #GFile. * @get_basename: Gets the basename for a given #GFile. * @get_path: Gets the current path within a #GFile. * @get_uri: Gets a URI for the path within a #GFile. * @get_parse_name: Gets the parsed name for the #GFile. * @get_parent: Gets the parent directory for the #GFile. * @prefix_matches: Checks whether a #GFile contains a specified file. * @get_relative_path: Gets the path for a #GFile relative to a given path. * @resolve_relative_path: Resolves a relative path for a #GFile to an absolute path. * @get_child_for_display_name: Gets the child #GFile for a given display name. * @enumerate_children: Gets a #GFileEnumerator with the children of a #GFile. * @enumerate_children_async: Asynchronously gets a #GFileEnumerator with the children of a #GFile. * @enumerate_children_finish: Finishes asynchronously enumerating the children. * @query_info: Gets the #GFileInfo for a #GFile. * @query_info_async: Asynchronously gets the #GFileInfo for a #GFile. * @query_info_finish: Finishes an asynchronous query info operation. * @query_filesystem_info: Gets a #GFileInfo for the file system #GFile is on. * @query_filesystem_info_async: Asynchronously gets a #GFileInfo for the file system #GFile is on. * @query_filesystem_info_finish: Finishes asynchronously getting the file system info. * @find_enclosing_mount: Gets a #GMount for the #GFile. * @find_enclosing_mount_async: Asynchronously gets the #GMount for a #GFile. * @find_enclosing_mount_finish: Finishes asynchronously getting the volume. * @set_display_name: Sets the display name for a #GFile. * @set_display_name_async: Asynchronously sets a #GFile's display name. * @set_display_name_finish: Finishes asynchronously setting a #GFile's display name. * @query_settable_attributes: Returns a list of #GFileAttribute<!-- -->s that can be set. * @_query_settable_attributes_async: Asynchronously gets a list of #GFileAttribute<!-- -->s that can be set. * @_query_settable_attributes_finish: Finishes asynchronously querying settable attributes. * @query_writable_namespaces: Returns a list of #GFileAttribute namespaces that are writable. * @_query_writable_namespaces_async: Asynchronously gets a list of #GFileAttribute namespaces that are writable. * @_query_writable_namespaces_finish: Finishes asynchronously querying the writable namespaces. * @set_attribute: Sets a #GFileAttribute. * @set_attributes_from_info: Sets a #GFileAttribute with information from a #GFileInfo. * @set_attributes_async: Asynchronously sets a file's attributes. * @set_attributes_finish: Finishes setting a file's attributes asynchronously. * @read_fn: Reads a file asynchronously. * @read_async: Asynchronously reads a file. * @read_finish: Finishes asynchronously reading a file. * @append_to: Writes to the end of a file. * @append_to_async: Asynchronously writes to the end of a file. * @append_to_finish: Finishes an asynchronous file append operation. * @create: Creates a new file. * @create_async: Asynchronously creates a file. * @create_finish: Finishes asynchronously creating a file. * @replace: Replaces the contents of a file. * @replace_async: Asynchronously replaces the contents of a file. * @replace_finish: Finishes asynchronously replacing a file. * @delete_file: Deletes a file. * @_delete_file_async: Asynchronously deletes a file. * @_delete_file_finish: Finishes an asynchronous delete. * @trash: Sends a #GFile to the Trash location. * @_trash_async: Asynchronously sends a #GFile to the Trash location. * @_trash_finish: Finishes an asynchronous file trashing operation. * @make_directory: Makes a directory. * @_make_directory_async: Asynchronously makes a directory. * @_make_directory_finish: Finishes making a directory asynchronously. * @make_symbolic_link: Makes a symbolic link. * @_make_symbolic_link_async: Asynchronously makes a symbolic link * @_make_symbolic_link_finish: Finishes making a symbolic link asynchronously. * @copy: Copies a file. * @copy_async: Asynchronously copies a file. * @copy_finish: Finishes an asynchronous copy operation. * @move: Moves a file. * @_move_async: Asynchronously moves a file. * @_move_finish: Finishes an asynchronous move operation. * @mount_mountable: Mounts a mountable object. * @mount_mountable_finish: Finishes a mounting operation. * @unmount_mountable: Unmounts a mountable object. * @unmount_mountable_finish: Finishes an unmount operation. * @eject_mountable: Ejects a mountable. * @eject_mountable_finish: Finishes an eject operation. * @mount_enclosing_volume: Mounts a specified location. * @mount_enclosing_volume_finish: Finishes mounting a specified location. * @monitor_dir: Creates a #GFileMonitor for the location. * @monitor_file: Creates a #GFileMonitor for the location. * * An interface for writing VFS file handles. **/struct _GFileIface{ GTypeInterface g_iface; /* Virtual Table */ GFile * (* dup) (GFile *file); guint (* hash) (GFile *file); gboolean (* equal) (GFile *file1, GFile *file2); gboolean (* is_native) (GFile *file); gboolean (* has_uri_scheme) (GFile *file, const char *uri_scheme); char * (* get_uri_scheme) (GFile *file); char * (* get_basename) (GFile *file); char * (* get_path) (GFile *file); char * (* get_uri) (GFile *file); char * (* get_parse_name) (GFile *file); GFile * (* get_parent) (GFile *file); gboolean (* prefix_matches) (GFile *prefix, GFile *file); char * (* get_relative_path) (GFile *parent, GFile *descendant); GFile * (* resolve_relative_path) (GFile *file, const char *relative_path); GFile * (* get_child_for_display_name) (GFile *file, const char *display_name, GError **error); GFileEnumerator * (* enumerate_children) (GFile *file, const char *attributes, GFileQueryInfoFlags flags, GCancellable *cancellable, GError **error); void (* enumerate_children_async) (GFile *file, const char *attributes, GFileQueryInfoFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileEnumerator * (* enumerate_children_finish) (GFile *file, GAsyncResult *res, GError **error); GFileInfo * (* query_info) (GFile *file, const char *attributes, GFileQueryInfoFlags flags, GCancellable *cancellable, GError **error); void (* query_info_async) (GFile *file, const char *attributes, GFileQueryInfoFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileInfo * (* query_info_finish) (GFile *file, GAsyncResult *res, GError **error); GFileInfo * (* query_filesystem_info) (GFile *file, const char *attributes, GCancellable *cancellable, GError **error); void (* query_filesystem_info_async) (GFile *file, const char *attributes,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -