Gimp.Scanner

Fields

None

Methods

class

new_file (file)

class

new_stream (input)

class

new_string (text)

parse_boolean ()

parse_color ()

parse_data ()

parse_double ()

parse_identifier ()

parse_int ()

parse_int64 ()

parse_matrix2 ()

parse_string ()

parse_string_no_validate ()

parse_token (token)

ref ()

unref ()

Details

class Gimp.Scanner

A wrapper around GLib.Scanner with some convenience API.

classmethod new_file(file)
Parameters:

file (Gio.File) – a Gio.File

Raises:

GLib.Error

Returns:

The new Gimp.Scanner.

Return type:

Gimp.Scanner

New in version 2.10.

classmethod new_stream(input)
Parameters:

input (Gio.InputStream) – a Gio.InputStream

Raises:

GLib.Error

Returns:

The new Gimp.Scanner.

Return type:

Gimp.Scanner

New in version 2.10.

classmethod new_string(text)
Parameters:

text ([str]) –

Raises:

GLib.Error

Returns:

The new Gimp.Scanner.

Return type:

Gimp.Scanner

New in version 2.4.

parse_boolean()
Returns:

True on success

dest:

Return location for the parsed boolean

Return type:

(bool, dest: bool)

New in version 2.4.

parse_color()
Returns:

True on success

color:

Pointer to a color to store the result

Return type:

(bool, color: Gegl.Color)

New in version 2.4.

parse_data()
Returns:

True on success

dest:

Return location for the parsed data

Return type:

(bool, dest: bytes)

New in version 2.4.

parse_double()
Returns:

True on success

dest:

Return location for the parsed double

Return type:

(bool, dest: float)

New in version 2.4.

parse_identifier()
Returns:

True if the next token is an identifier and if its value matches identifier.

identifier:

the expected identifier.

Return type:

(bool, identifier: str)

New in version 2.4.

parse_int()
Returns:

True on success

dest:

Return location for the parsed integer

Return type:

(bool, dest: int)

New in version 2.4.

parse_int64()
Returns:

True on success

dest:

Return location for the parsed integer

Return type:

(bool, dest: int)

New in version 2.8.

parse_matrix2()
Returns:

True on success

dest:

Pointer to a matrix to store the result

Return type:

(bool, dest: Gimp.Matrix2)

New in version 2.4.

parse_string()
Returns:

True on success

dest:

Return location for the parsed string

Return type:

(bool, dest: str)

New in version 2.4.

parse_string_no_validate()
Returns:

True on success

dest:

Return location for the parsed string

Return type:

(bool, dest: str)

New in version 2.4.

parse_token(token)
Parameters:

token (GLib.TokenType) – the GLib.TokenType expected as next token.

Returns:

True if the next token is token, False otherwise.

Return type:

bool

New in version 2.4.

ref()
Returns:

the same self.

Return type:

Gimp.Scanner

Adds a reference to a Gimp.Scanner.

New in version 3.0.

unref()

Unref a Gimp.Scanner. If the reference count drops to zero, the scanner is freed.

New in version 3.0.