![]() |
![]() |
![]() |
libfm Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define FM_PATH (path) FmPath; typedef FmPathList; #define fm_path_new (path) FmPath* fm_path_new_child (FmPath *parent
,const char *basename
); FmPath* fm_path_new_child_len (FmPath *parent
,const char *basename
,int name_len
); FmPath* fm_path_new_relative (FmPath *parent
,const char *relative_path
); FmPath* fm_path_new_for_gfile (GFile *gf
); FmPath* fm_path_get_root (); FmPath* fm_path_get_home (); FmPath* fm_path_get_desktop (); FmPath* fm_path_get_trash (); FmPath* fm_path_get_apps_menu (); FmPath* fm_path_ref (FmPath *path
); void fm_path_unref (FmPath *path
); FmPath* fm_path_get_parent (FmPath *path
); const char* fm_path_get_basename (FmPath *path
); FmPathFlags fm_path_get_flags (FmPath *path
); #define fm_path_is_native (path) #define fm_path_is_trash (path) #define fm_path_is_trash_root (path) #define fm_path_is_virtual (path) #define fm_path_is_local (path) #define fm_path_is_xdg_menu (path) char* fm_path_to_str (FmPath *path
); char* fm_path_to_uri (FmPath *path
); GFile* fm_path_to_gfile (FmPath *path
); char* fm_path_display_name (FmPath *path
,gboolean human_readable
); char* fm_path_display_basename (FmPath *path
); guint fm_path_hash (FmPath *path
); gboolean fm_path_equal (FmPath *p1
,FmPath *p2
); gboolean fm_path_equal_str (FmPath *path
,const gchar *str
,int n
); FmPathList* fm_path_list_new (); FmPathList* fm_path_list_new_from_uri_list (const char *uri_list
); FmPathList* fm_path_list_new_from_uris (const char **uris
); FmPathList* fm_path_list_new_from_file_info_list (FmList *fis
); FmPathList* fm_path_list_new_from_file_info_glist (GList *fis
); FmPathList* fm_path_list_new_from_file_info_gslist (GSList *fis
); gboolean fm_list_is_path_list (FmList *list
); char* fm_path_list_to_uri_list (FmPathList *pl
); void fm_path_list_write_uri_list (FmPathList *pl
,GString *buf
);
typedef struct { gint n_ref; FmPath* parent; guchar flags; /* FmPathFlags flags : 8; */ char name[1]; } FmPath;
FmPath* fm_path_new_child (FmPath *parent
,const char *basename
);
|
a parent path |
|
basename of a direct child of parent directory in glib
filename encoding. (can be non-UTF-8).
|
Returns : |
a newly created FmPath for the path. You have to call
fm_path_unref() when it's no longer needed.
|
FmPath* fm_path_new_child_len (FmPath *parent
,const char *basename
,int name_len
);
|
a parent path |
|
basename of a direct child of parent directory in glib
filename encoding. (can be non-UTF-8).
|
|
length of basename |
Returns : |
a newly created FmPath for the path. You have to call
fm_path_unref() when it's no longer needed.
|
FmPath* fm_path_new_relative (FmPath *parent
,const char *relative_path
);
For example, if parent
is "http://wiki.lxde.org/" and rel
is
"zh/E9
%A696
%E9A0
%81", you have to unescape the relative path
prior to passing it to fm_path_new_relative()
.
If parent
is NULL, this works the same as fm_path_new_for_str(rel
)
|
a parent path |
|
a path relative to parent in glib filename encoding. (can be
non-UTF-8). However this should not be a escaped ASCII string used in
URI. If you're building a relative path for a URI, and the relative
path is escaped, you have to unescape it first.
|
Returns : |
a newly created FmPath for the path. You have to call
fm_path_unref() when it's no longer needed.
|
FmPath* fm_path_new_for_gfile (GFile *gf
);
This function converts a GFile object to FmPath.
|
a GFile object |
Returns : |
a newly created FmPath for the path. You have to call
fm_path_unref() when it's no longer needed.
|
#define fm_path_is_xdg_menu(path) (fm_path_get_flags(path)&FM_PATH_IS_XDG_MENU)
FmPathList* fm_path_list_new_from_uri_list (const char *uri_list
);
FmPathList* fm_path_list_new_from_file_info_list
(FmList *fis
);
FmPathList* fm_path_list_new_from_file_info_glist
(GList *fis
);
FmPathList* fm_path_list_new_from_file_info_gslist
(GSList *fis
);