Mirage.Parser¶
- Subclasses:
None
Methods¶
- Inherited:
Mirage.Object (2), GObject.Object (37), Mirage.Contextual (8)
- Structs:
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Mirage.Parser(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
All the fields in the
Mirage.Parser
structure are private to theMirage.Parser
implementation and should never be accessed directly.- add_redbook_pregap(disc)¶
- Parameters:
disc (
Mirage.Disc
) – disc object
A helper function, intended to be used in simpler parsers that don’t get proper pregap information from the image file.
First, it sets disc layout start to -150. Then, it adds 150-sector pregap to first track of each session found on the layout; for this, a
None
fragment is used. If track already has a pregap, then the pregaps are stacked.Note that the function works only on discs which have medium type set to CD-ROM. On other discs, it does nothing.
- create_text_stream(stream)¶
- Parameters:
stream (
Mirage.Stream
) – aMirage.Stream
- Raises:
- Returns:
a
Gio.DataInputStream
object on success, orNone
on failure.- Return type:
Constructs a filter chain for reading text files on top of provided stream. First, if encoding is provided via parser parameters, or if a multi-byte encoding is detected, a
Gio.ConverterInputStream
with aGio.CharsetConverter
is applied. Then on top of it, aGio.DataInputStream
is created, which can be used to read text file line-by-line.
- get_info()¶
- Returns:
a pointer to parser information structure. The structure belongs to object and should not be modified.
- Return type:
Retrieves parser information.
- guess_medium_type(disc)¶
- Parameters:
disc (
Mirage.Disc
) – disc object- Returns:
a value from
Mirage.MediumType
, according to the guessed medium type.- Return type:
Attempts to guess medium type by looking at the length of the disc layout. Currently, it supports identification of CD-ROM media, which are assumed to have layout length of 90 minutes or less.
Note that this function does not set the medium type to disc object; you still need to do it via
Mirage.Disc.set_medium_type
(). It is meant to be used in simple parsers whose image files don’t provide medium type information.
- load_image(streams)¶
- Parameters:
streams ([
Mirage.Stream
]) –None
-terminated array of data streams- Raises:
- Returns:
a
Mirage.Disc
object representing image on success,None
on failure- Return type:
Loads the image stored in streams.
- do_load_image(streams) virtual¶
- Parameters:
streams ([
Mirage.Stream
]) –None
-terminated array of data streams- Returns:
a
Mirage.Disc
object representing image on success,None
on failure- Return type:
Loads the image stored in streams.