LoaderFileTypeRegistry

class LoaderFileTypeRegistry

This class maintains the set of all known LoaderFileTypes in the universe.

Inheritance diagram

Inheritance diagram of LoaderFileTypeRegistry

LoaderFileTypeRegistry(LoaderFileTypeRegistry const&) = default
static LoaderFileTypeRegistry *get_global_ptr(void)

Returns a pointer to the global LoaderFileTypeRegistry object.

int get_num_types(void) const

Returns the total number of types registered.

LoaderFileType *get_type(int n) const

Returns the nth type registered.

LoaderFileType *get_type_from_extension(std::string const &extension)

Determines the type of the file based on the indicated extension (without a leading dot). Returns NULL if the extension matches no known file types.

void register_deferred_type(PyObject *entry_point)

Records a type associated with a particular extension to be loaded in the future. The named library will be dynamically loaded the first time files of this extension are loaded; presumably this library will call register_type() when it initializes, thus making the extension loadable.

void register_type(PyObject *type)

Defines a new LoaderFileType in the universe.

void unregister_type(PyObject *type)

Removes a type previously registered using register_type.

void write(std::ostream &out, int indent_level = 0) const

Writes a list of supported file types to the indicated output stream, one per line.