Method

FoundryTextManagerguess_language

Declaration [src]

DexFuture*
foundry_text_manager_guess_language (
  FoundryTextManager* self,
  GFile* file,
  const char* content_type,
  GBytes* contents
)

Description [src]

Attempts to guess the language of file, content_type, or contents.

One of file, content_type, or contents must be set.

Parameters

file

Type: GFile

A GFile or NULL.

The argument can be NULL.
The data is owned by the caller of the method.
content_type

Type: const char*

The content-type as a string or NULL.

The argument can be NULL.
The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
contents

Type: GBytes

A GBytes of file contents or NULL.

The argument can be NULL.
The data is owned by the caller of the method.

Return value

Type: DexFuture

A DexFuture that resolves to a string containing the language identifier, or rejects with error.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.