## ide-unsaved-files ide-unsaved-files |

## Functions

void | ide_unsaved_files_update ()
void | ide_unsaved_files_remove ()
void | ide_unsaved_files_save_async ()
gboolean | ide_unsaved_files_save_finish ()
void | ide_unsaved_files_restore_async ()
gboolean | ide_unsaved_files_restore_finish ()
GPtrArray * | ide_unsaved_files_to_array ()
gint64 | ide_unsaved_files_get_sequence ()
IdeUnsavedFile * | ide_unsaved_files_get_unsaved_file ()
void | ide_unsaved_files_clear ()
gboolean | ide_unsaved_files_contains ()

## Types and Values

#define | IDE_TYPE_UNSAVED_FILES
| IdeUnsavedFiles

## Description

## Functions

### ide_unsaved_files_update ()

    void
    ide_unsaved_files_update (IdeUnsavedFiles *self,
                              GFile *file,
                              GBytes *content);

### ide_unsaved_files_remove ()

    void
    ide_unsaved_files_remove (IdeUnsavedFiles *self,
                              GFile *file);

### ide_unsaved_files_save_async ()

    void
    ide_unsaved_files_save_async (IdeUnsavedFiles *files,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

### ide_unsaved_files_save_finish ()

    gboolean
    ide_unsaved_files_save_finish (IdeUnsavedFiles *files,
                                   GAsyncResult *result,
                                   GError **error);

### ide_unsaved_files_restore_async ()

    void
    ide_unsaved_files_restore_async (IdeUnsavedFiles *files,
                                     GCancellable *cancellable,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

### ide_unsaved_files_restore_finish ()

    gboolean
    ide_unsaved_files_restore_finish (IdeUnsavedFiles *files,
                                      GAsyncResult *result,
                                      GError **error);

### ide_unsaved_files_to_array ()

    GPtrArray *
    ide_unsaved_files_to_array (IdeUnsavedFiles *files);

This retrieves all of the unsaved file buffers known to the context. These are handy if you need to pass modified state to parsers such as clang.

Call `g_ptr_array_unref()` on the resulting GPtrArray when no longer in use.

If you would like to hold onto an unsaved file instance, call `ide_unsaved_file_ref()` to increment it's reference count.

#### Returns

A GPtrArray containing IdeUnsavedFile elements.

[transfer container][element-type IdeUnsavedFile*]

### ide_unsaved_files_get_sequence ()

    gint64
    ide_unsaved_files_get_sequence (IdeUnsavedFiles *files);

### ide_unsaved_files_get_unsaved_file ()

    IdeUnsavedFile *
    ide_unsaved_files_get_unsaved_file (IdeUnsavedFiles *self,
                                        GFile *file);

Retrieves the unsaved file content for a particular file. If no unsaved file content is registered, `NULL` is returned.

#### Returns

An IdeUnsavedFile or `NULL`.

[nullable][transfer full]

### ide_unsaved_files_clear ()

    void
    ide_unsaved_files_clear (IdeUnsavedFiles *self);

### ide_unsaved_files_contains ()

    gboolean
    ide_unsaved_files_contains (IdeUnsavedFiles *self,
                                GFile *file);

## Types and Values

### IDE_TYPE_UNSAVED_FILES

    #define IDE_TYPE_UNSAVED_FILES (ide_unsaved_files_get_type())

### IdeUnsavedFiles

    typedef struct {
      IdeObject parent_instance;
    } IdeUnsavedFiles;