## ide-source-location ide-source-location |

## Functions

IdeSourceLocation * | ide_source_location_ref ()
void | ide_source_location_unref ()
IdeSourceLocation * | ide_source_location_new ()
IdeSourceLocation * | ide_source_location_new_from_variant ()
IdeSourceLocation * | ide_source_location_new_for_path ()
guint | ide_source_location_get_line ()
guint | ide_source_location_get_line_offset ()
guint | ide_source_location_get_offset ()
IdeFile * | ide_source_location_get_file ()
IdeUri * | ide_source_location_get_uri ()
const gchar * | ide_source_location_get_path ()
gint | ide_source_location_compare ()
guint | ide_source_location_hash ()
GVariant * | ide_source_location_to_variant ()

## Description

## Functions

### ide_source_location_ref ()

    IdeSourceLocation *
    ide_source_location_ref (IdeSourceLocation *self);

Increments the reference count of `self` by one.

#### Returns

self.

[transfer full]

### ide_source_location_unref ()

    void
    ide_source_location_unref (IdeSourceLocation *self);

Decrements the reference count of `self` by one. If the reference count reaches zero, then the structure is freed.

### ide_source_location_new ()

    IdeSourceLocation *
    ide_source_location_new (IdeFile *file,
                             guint line,
                             guint line_offset,
                             guint offset);

Creates a new IdeSourceLocation, using the file, line, column, and character offset provided.

#### Parameters

file | an IdeFile |
line | the line number starting from zero |
line_offset | the character offset within the line |
offset | the character offset in the file |

#### Returns

A newly allocated IdeSourceLocation.

[transfer full]

### ide_source_location_new_from_variant ()

    IdeSourceLocation *
    ide_source_location_new_from_variant (GVariant *variant);

Creates a new IdeSourceLocation using the serialized form from a previously serialized GVariant.

As a convenience, if `variant` is `NULL`, `NULL` is returned.

See also: `ide_source_location_to_variant()`

#### Parameters

variant | a GVariant or `NULL`. | [nullable]

#### Returns

a GVariant if succesful; otherwise `NULL`.

[transfer full][nullable]

Since: 3.30

### ide_source_location_new_for_path ()

    IdeSourceLocation *
    ide_source_location_new_for_path (IdeContext *context,
                                      const gchar *path,
                                      guint line,
                                      guint line_offset);

### ide_source_location_get_line ()

    guint
    ide_source_location_get_line (IdeSourceLocation *self);

Retrieves the target line number starting from 0.

#### Returns

a guint containing the target line.

### ide_source_location_get_line_offset ()

    guint
    ide_source_location_get_line_offset (IdeSourceLocation *self);

Retrieves the character offset within the line.

#### Returns

a guint containing the offset within the line.

### ide_source_location_get_offset ()

    guint
    ide_source_location_get_offset (IdeSourceLocation *self);

Retrieves the character offset within the file.

#### Returns

a guint containing the character offset within the file.

### ide_source_location_get_file ()

    IdeFile *
    ide_source_location_get_file (IdeSourceLocation *self);

The file represented by this source location.

#### Returns

An IdeFile.

[transfer none]

### ide_source_location_get_uri ()

    IdeUri *
    ide_source_location_get_uri (IdeSourceLocation *self);

#### Parameters

self | an IdeSourceLocation. | [in]

#### Returns

A newly allocated IdeUri.

[transfer full]

### ide_source_location_get_path ()

    const gchar *
    ide_source_location_get_path (IdeSourceLocation *self);

Gets the path for the file represented by the location.

Will return `NULL` if the path is not native.

#### Parameters

self | a IdeSourceLocation |

#### Returns

a path or `NULL` if not local.

[nullable]

### ide_source_location_compare ()

    gint
    ide_source_location_compare (const IdeSourceLocation *a,
                                 const IdeSourceLocation *b);

### ide_source_location_hash ()

    guint
    ide_source_location_hash (IdeSourceLocation *self);

### ide_source_location_to_variant ()

    GVariant *
    ide_source_location_to_variant (const IdeSourceLocation *self);

Serializes the location into a variant that can be used to transport across IPC boundaries.

This function will never return a variant with a floating reference.

#### Parameters

self | a IdeSourceLocation |

#### Returns

a GVariant.

[transfer full]

## Types and Values