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

## Functions

IdeUnsavedFiles * | ide_unsaved_files_from_context ()
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 ()
void | ide_unsaved_files_reap_async ()
gboolean | ide_unsaved_files_reap_finish ()

## Properties

gchar * | project-id | Read / Write / Construct Only

## Types and Values

#define | IDE_TYPE_UNSAVED_FILES
| IdeUnsavedFiles

## Object Hierarchy

        GObject
        ╰── IdeObject
            ╰── IdeUnsavedFiles

## Description

## Functions

### ide_unsaved_files_from_context ()

    IdeUnsavedFiles *
    ide_unsaved_files_from_context (IdeContext *context);

Gets the unsaved files object for `context` .

#### Parameters

context | an IdeContext |

#### Returns

an IdeContext.

[transfer none]

Since: 3.32

### 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 *self);

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 its reference count.

#### Parameters

self | an IdeUnsavedFiles |

#### Returns

a GPtrArray containing IdeUnsavedFile elements.

[transfer full][element-type Ide.UnsavedFile]

Since: 3.32

### 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`.

Thread safety: you may call this from any thread, as long as you hold a reference to `self` .

[nullable][transfer full]

Since: 3.32

### ide_unsaved_files_clear ()

    void
    ide_unsaved_files_clear (IdeUnsavedFiles *self);

### ide_unsaved_files_contains ()

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

### ide_unsaved_files_reap_async ()

    void
    ide_unsaved_files_reap_async (IdeUnsavedFiles *self,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

### ide_unsaved_files_reap_finish ()

    gboolean
    ide_unsaved_files_reap_finish (IdeUnsavedFiles *self,
                                   GAsyncResult *result,
                                   GError **error);

## Types and Values

### IDE_TYPE_UNSAVED_FILES

    #define IDE_TYPE_UNSAVED_FILES (ide_unsaved_files_get_type())

### IdeUnsavedFiles

    typedef struct _IdeUnsavedFiles IdeUnsavedFiles;

## Property Details

### The `“project-id”` property

      “project-id”               gchar *

The identifier for the project.

Owner: IdeUnsavedFiles

Flags: Read / Write / Construct Only

Default value: NULL