Base interface for classes that can read and optionally write certain file formats.
interface
|
IFileFormat
|
extends
|
IPleaseIncludeInBinaryThanks
|
||
base of
|
FileFormat
|
Long description of this file format.
property
|
Description
{
get
}
|
||
type
|
string
|
||
value
|
|
The description string. |
The machine-readable type of this file format.
property
|
Mime
{
get
}
|
||
type
|
string
|
||
value
|
The
machine-readable
media
type
or
null
if
none. |
Remarks:
For
details
on
Media
Types
(aka.
MIME-type),
please
refer
to
this
webpage:
https://www.iana.org/assignments/media-types/media-types.xhtml
The file format name.
property
|
Name
{
get
}
|
||
type
|
string
|
||
value
|
|
The file format name. |
Returns the next file format.
[ThreadSafe]
|
||||
property
|
Next
{
get
}
|
|||
type
|
IFileFormat
|
|||
value
|
The
next
file
format
or
null . |
Remarks:
The first file format can be obtained from implementing classes. This property can be used to cycle all available file formats of the same type.
Lengths of the binary file data prefix that identifies this file format.
property
|
Prefix
{
get
}
|
||
type
|
int32
|
||
value
|
|
The
file
data
prefix
length,
in
bytes.
If
0 ,
there
is
no
identifying
prefix.
|
The human-readable type of this file format (e.g. images, shapes, 3D models).
property
|
Type
{
get
}
|
||
type
|
string
|
||
value
|
|
The human-readable type name. |
Can this file format object be used to read the given data?
method
|
CanRead
(ByteBuffer data)
|
||
type
|
bool
|
||
params
|
data
|
[not-null]
|
The
data
to
check.
Must
have
at
least
Prefix
remaining
bytes,
otherwise
this
method
will
always
return
false .
The
buffer
will
not
be
modified
by
this
method.
|
returns
|
true
if
the
given
data
is
prefixed
with
the
identifying
byte
sequence
of
this
file
format,
false
if
the
prefix
is
not
present.
|
See also:
PrefixCan this file format object be used to read the given path?
method
|
CanRead
(string suffix,
bool directory = false)
|
||
type
|
bool
|
||
params
|
suffix
|
[not-null]
|
The
lower-case
pathname
suffix
(without
'.' ).
Will
be
empty
if
the
path
does
not
have
a
pathname
suffix.
|
directory
|
Does
the
path
refer
to
a
directory
(true )
or
to
a
file
(false )?
Defaults
to
false .
|
||
returns
|
true
if
this
file
format
can
be
used,
false
if
not. |
Returns the first file format in the chain (see Next) that can read the given data.
method
|
CanReadFind
(ByteBuffer data)
|
||
type
|
IFileFormat
|
||
params
|
data
|
[not-null]
|
The
data
to
check.
Must
have
at
least
Prefix
remaining
bytes,
otherwise
this
method
will
always
return
false .
The
buffer
will
not
be
modified
by
this
method.
|
returns
|
The
found
file
format
or
null . |
Returns the first file format in the chain (see Next) that can read the given path.
method
|
CanReadFind
(string suffix,
bool directory = false)
|
||
type
|
IFileFormat
|
||
params
|
suffix
|
[not-null]
|
The
lower-case
pathname
suffix
(without
'.' ).
Will
be
empty
if
the
path
does
not
have
a
pathname
suffix.
|
directory
|
Does
the
path
refer
to
a
directory
(true )
or
to
a
file
(false )?
Defaults
to
false .
|
||
returns
|
The
found
file
format
or
null . |
Can this file format object be used to write the given path?
method
|
CanWrite
(string suffix)
|
||
type
|
bool
|
||
params
|
suffix
|
[not-null]
|
The
lower-case
pathname
suffix
(without
'.' ).
Will
be
empty
if
the
path
does
not
have
a
pathname
suffix.
|
returns
|
true
if
this
file
format
can
be
used,
false
if
not. |
Returns the first file format in the chain (see Next) that can write the given path.
method
|
CanWriteFind
(string suffix)
|
||
type
|
IFileFormat
|
||
params
|
suffix
|
[not-null]
|
The
lower-case
pathname
suffix
(without
'.' ).
Will
be
empty
if
the
path
does
not
have
a
pathname
suffix.
|
returns
|
The
found
file
format
or
null . |
This is a method that forces the compiler / linker to include this type in the resulting binary.
method
|
PleaseIncludeInBinaryThanks
()
|
||
inherited
|
IPleaseIncludeInBinaryThanks.PleaseIncludeInBinaryThanks
|
Remarks:
Calling this stub method makes sure that all lazy constructor calls have been made.
To initialize everything, an application needs to call this method on its root module(s) (see TinmanModule), followed by a call to Initialize.
Exceptions: