## fm-file-info

fm-file-info

## Synopsis

    #define             FM_FILE_INFO                        (ptr)
    struct              FmFileInfo;
    typedef             FmFileInfoList;
    gboolean            fm_file_info_can_thumbnail          (FmFileInfo *fi);
    void                fm_file_info_copy                   (FmFileInfo *fi,
                                                             FmFileInfo *src);
    time_t *            fm_file_info_get_atime              (FmFileInfo *fi);
    goffset             fm_file_info_get_blocks             (FmFileInfo *fi);
    const char *        fm_file_info_get_collate_key        (FmFileInfo *fi);
    const char *        fm_file_info_get_desc               (FmFileInfo *fi);
    const char *        fm_file_info_get_disp_mtime         (FmFileInfo *fi);
    const char *        fm_file_info_get_disp_name          (FmFileInfo *fi);
    const char *        fm_file_info_get_disp_size          (FmFileInfo *fi);
    FmMimeType *        fm_file_info_get_mime_type          (FmFileInfo *fi);
    mode_t              fm_file_info_get_mode               (FmFileInfo *fi);
    time_t *            fm_file_info_get_mtime              (FmFileInfo *fi);
    const char *        fm_file_info_get_name               (FmFileInfo *fi);
    FmPath *            fm_file_info_get_path               (FmFileInfo *fi);
    goffset             fm_file_info_get_size               (FmFileInfo *fi);
    const char *        fm_file_info_get_target             (FmFileInfo *fi);
    gboolean            fm_file_info_is_desktop_entry       (FmFileInfo *fi);
    gboolean            fm_file_info_is_dir                 (FmFileInfo *fi);
    gboolean            fm_file_info_is_executable_type     (FmFileInfo *fi);
    gboolean            fm_file_info_is_hidden              (FmFileInfo *fi);
    gboolean            fm_file_info_is_image               (FmFileInfo *fi);
    gboolean            fm_file_info_is_mountable           (FmFileInfo *fi);
    gboolean            fm_file_info_is_shortcut            (FmFileInfo *fi);
    gboolean            fm_file_info_is_symlink             (FmFileInfo *fi);
    gboolean            fm_file_info_is_text                (FmFileInfo *fi);
    gboolean            fm_file_info_is_unknown_type        (FmFileInfo *fi);
    gboolean            fm_file_info_list_is_same_fs        (FmFileInfoList *list);
    gboolean            fm_file_info_list_is_same_type      (FmFileInfoList *list);
    FmFileInfoList *    fm_file_info_list_new               ();
    FmFileInfoList *    fm_file_info_list_new_from_glist    ();
    FmFileInfo *        fm_file_info_new                    ();
    FmFileInfo *        fm_file_info_new_from_gfileinfo     (FmPath *path,
                                                             GFileInfo *inf);
    FmFileInfo *        fm_file_info_ref                    (FmFileInfo *fi);
    void                fm_file_info_set_disp_name          (FmFileInfo *fi,
                                                             const char *name);
    void                fm_file_info_set_from_gfileinfo     (FmFileInfo *fi,
                                                             GFileInfo *inf);
    void                fm_file_info_set_path               (FmFileInfo *fi,
                                                             FmPath *path);
    void                fm_file_info_unref                  (FmFileInfo *fi);
    gboolean            fm_list_is_file_info_list           (FmList *list);

## Description

## Details

### FM_FILE_INFO()

    #define FM_FILE_INFO(ptr)    ((FmFileInfo*)ptr)

### struct FmFileInfo

    struct FmFileInfo {
        FmPath* path; /* path of the file */

        mode_t mode;
        union {
            const char* fs_id;
            dev_t dev;
        };
        uid_t uid;
        gid_t gid;
        goffset size;
        time_t mtime;
        time_t atime;

        gulong blksize;
        goffset blocks;

        char* disp_name;  /* displayed name (in UTF-8) */

        /* FIXME: caching the collate key can greatly speed up sorting.
         *        However, memory usage is greatly increased!.
         *        Is there a better alternative solution?
         */
        char* collate_key; /* used to sort files by name */
        char* disp_size;  /* displayed human-readable file size */
        char* disp_mtime; /* displayed last modification time */
        FmMimeType* type;
        FmIcon* icon;

        char* target; /* target of shortcut or mountable. */
    };

### FmFileInfoList

    typedef FmList FmFileInfoList;

### fm_file_info_can_thumbnail ()

    gboolean            fm_file_info_can_thumbnail          (FmFileInfo *fi);

### fm_file_info_copy ()

    void                fm_file_info_copy                   (FmFileInfo *fi,
                                                             FmFileInfo *src);

### fm_file_info_get_atime ()

    time_t *            fm_file_info_get_atime              (FmFileInfo *fi);

### fm_file_info_get_blocks ()

    goffset             fm_file_info_get_blocks             (FmFileInfo *fi);

### fm_file_info_get_collate_key ()

    const char *        fm_file_info_get_collate_key        (FmFileInfo *fi);

### fm_file_info_get_desc ()

    const char *        fm_file_info_get_desc               (FmFileInfo *fi);

### fm_file_info_get_disp_mtime ()

    const char *        fm_file_info_get_disp_mtime         (FmFileInfo *fi);

### fm_file_info_get_disp_name ()

    const char *        fm_file_info_get_disp_name          (FmFileInfo *fi);

### fm_file_info_get_disp_size ()

    const char *        fm_file_info_get_disp_size          (FmFileInfo *fi);

### fm_file_info_get_mime_type ()

    FmMimeType *        fm_file_info_get_mime_type          (FmFileInfo *fi);

### fm_file_info_get_mode ()

    mode_t              fm_file_info_get_mode               (FmFileInfo *fi);

### fm_file_info_get_mtime ()

    time_t *            fm_file_info_get_mtime              (FmFileInfo *fi);

### fm_file_info_get_name ()

    const char *        fm_file_info_get_name               (FmFileInfo *fi);

### fm_file_info_get_path ()

    FmPath *            fm_file_info_get_path               (FmFileInfo *fi);

### fm_file_info_get_size ()

    goffset             fm_file_info_get_size               (FmFileInfo *fi);

### fm_file_info_get_target ()

    const char *        fm_file_info_get_target             (FmFileInfo *fi);

### fm_file_info_is_desktop_entry ()

    gboolean            fm_file_info_is_desktop_entry       (FmFileInfo *fi);

### fm_file_info_is_dir ()

    gboolean            fm_file_info_is_dir                 (FmFileInfo *fi);

### fm_file_info_is_executable_type ()

    gboolean            fm_file_info_is_executable_type     (FmFileInfo *fi);

### fm_file_info_is_hidden ()

    gboolean            fm_file_info_is_hidden              (FmFileInfo *fi);

### fm_file_info_is_image ()

    gboolean            fm_file_info_is_image               (FmFileInfo *fi);

### fm_file_info_is_mountable ()

    gboolean            fm_file_info_is_mountable           (FmFileInfo *fi);

### fm_file_info_is_shortcut ()

    gboolean            fm_file_info_is_shortcut            (FmFileInfo *fi);

### fm_file_info_is_symlink ()

    gboolean            fm_file_info_is_symlink             (FmFileInfo *fi);

### fm_file_info_is_text ()

    gboolean            fm_file_info_is_text                (FmFileInfo *fi);

### fm_file_info_is_unknown_type ()

    gboolean            fm_file_info_is_unknown_type        (FmFileInfo *fi);

### fm_file_info_list_is_same_fs ()

    gboolean            fm_file_info_list_is_same_fs        (FmFileInfoList *list);

### fm_file_info_list_is_same_type ()

    gboolean            fm_file_info_list_is_same_type      (FmFileInfoList *list);

### fm_file_info_list_new ()

    FmFileInfoList *    fm_file_info_list_new               ();

### fm_file_info_list_new_from_glist ()

    FmFileInfoList *    fm_file_info_list_new_from_glist    ();

### fm_file_info_new ()

    FmFileInfo *        fm_file_info_new                    ();

### fm_file_info_new_from_gfileinfo ()

    FmFileInfo *        fm_file_info_new_from_gfileinfo     (FmPath *path,
                                                             GFileInfo *inf);

### fm_file_info_ref ()

    FmFileInfo *        fm_file_info_ref                    (FmFileInfo *fi);

### fm_file_info_set_disp_name ()

    void                fm_file_info_set_disp_name          (FmFileInfo *fi,
                                                             const char *name);

### fm_file_info_set_from_gfileinfo ()

    void                fm_file_info_set_from_gfileinfo     (FmFileInfo *fi,
                                                             GFileInfo *inf);

### fm_file_info_set_path ()

    void                fm_file_info_set_path               (FmFileInfo *fi,
                                                             FmPath *path);

### fm_file_info_unref ()

    void                fm_file_info_unref                  (FmFileInfo *fi);

### fm_list_is_file_info_list ()

    gboolean            fm_list_is_file_info_list           (FmList *list);