annotation Chem::IO::FileType

Overview

Marks a class as a provider of a file format.

A file type associates extensions and/or file names with a file format, and links the latter to the annotated classes. If the file format does not exist, it is registered.

This annotation accepts the file format (required), and either an array of extensions (without leading dot) or an array of file names, or both. File names can include wildcards () to denote either prefix (e.g., "Foo"), suffix (e.g., "*Bar"), or both (e.g., "Baz").

@[FileType(format: Log, ext: %w(txt log out), names: %w(LOG *OUT))]
class LogParser
end

Defined in:

chem/io/formats.cr