## FmFile FmFile — Extensions for GFile interface. |

## Functions

void | fm_file_add_vfs ()
GFile * | fm_file_new_for_commandline_arg ()
GFile * | fm_file_new_for_uri ()
gboolean | fm_file_wants_incremental ()

## Types and Values

| FmFile
struct | FmFileInitTable
struct | FmFileInterface
#define | FM_MODULE_vfs_VERSION
extern FmFileInitTable | fm_module_init_vfs

## Object Hierarchy

        GInterface
        ╰── FmFile

## Prerequisites

FmFile requires GFile and GObject.

## Description

`include` : libfm/fm.h

The FmFile represents interface to build extensions to GFile which will handle schemas that are absent in Glib/GVFS - such as "search:".

To use it the GFile implementation should also implement FmFile vtable calls. The implementation should be added to list of known schemes via call to `fm_file_add_vfs()` then calls such as `fm_file_new_for_uri()` can use it.

## Functions

### fm_file_add_vfs ()

    void
    fm_file_add_vfs (const char *name,
                     FmFileInitTable *init);

Adds VFS to list of extensions that will be applied on next call to `fm_file_new_for_uri()` or `fm_file_new_for_commandline_arg()`. The `name` is a schema which will be handled by those calls.

#### Parameters

name | scheme to act upon |
init | table of functions |

Since: 1.0.2

### fm_file_new_for_commandline_arg ()

    GFile *
    fm_file_new_for_commandline_arg (const char *arg);

Creates a GFile with the given argument from the command line. The value of `arg` can be either a URI, an absolute path or a relative path resolved relative to the current working directory. This operation never fails, but the returned object might not support any I/O operation if `arg` points to a malformed path.

#### Parameters

arg | a command line string |

#### Returns

a new GFile.

Since: 1.0.2

### fm_file_new_for_uri ()

    GFile *
    fm_file_new_for_uri (const char *uri);

Constructs a GFile for a given URI. This operation never fails, but the returned object might not support any I/O operation if `uri` is malformed or if the uri type is not supported.

#### Parameters

uri | a UTF8 string containing a URI |

#### Returns

a new GFile.

Since: 1.0.2

### fm_file_wants_incremental ()

    gboolean
    fm_file_wants_incremental (GFile *file);

Checks if contents of directory `file` cannot be retrieved at once so scanning it may be done in incremental manner for the best results.

#### Parameters

file | file to inspect |

#### Returns

`TRUE` if retrieve of contents of `file` will be incremental.

Since: 1.0.2

## Types and Values

### FmFile

    typedef struct _FmFile FmFile;

### struct FmFileInitTable

    struct FmFileInitTable {
        GFile * (*new_for_uri)(const char *uri);
    };

Functions to initialize FmFile instance.

This structure is used for "vfs" module initialization. The key for module of this type is scheme name to support.

#### Members

`new_for_uri` () | function to create new GFile object from URI |

### struct FmFileInterface

    struct FmFileInterface {
        gboolean (*wants_incremental)(GFile* file);
    };

#### Members

`wants_incremental` () | VTable func, see `fm_file_wants_incremental()` |

### FM_MODULE_vfs_VERSION

    #define FM_MODULE_vfs_VERSION 1

### fm_module_init_vfs

    extern FmFileInitTable fm_module_init_vfs;