neuray API Programmer's Manual

mi::neuraylib::IImpexp_base Class Reference

[Importer and Exporter]

Description

Abstract base interface common for importers and exporters. The common functionality of importers and exporters comprises a factory function for the corresponding state, a test function to indicate support of a particular file extension, and additional methods to provide information about the importer or exporter, like author, version number, UUID, and so on.

Public Member Functions

virtual IImpexp_statecreate_impexp_state( const char* uri, const IImpexp_state* parent_state = 0) const =0
Returns a state suitable for passing it to a recursive import or export call. More...
virtual const char* get_author() const =0
Returns a concise single-line clear text description of the author of this importer or exporter. More...
virtual Uint32 get_major_version() const =0
Returns the major version number of the importer or exporter. More...
virtual Uint32 get_minor_version() const =0
Returns the minor version number of the importer or exporter. More...
virtual const char* get_name() const =0
Returns a concise single-line clear text description of the importer or exporter. More...
virtual Impexp_priority get_priority() const =0
Returns the priority of the importer or exporter. More...
virtual const char* get_supported_extensions( Uint32 i) const =0
Returns the i -th supported file name extension. More...
virtual base::​Uuid get_uuid() const =0
Returns the unique identifier for the importer or exporter. More...
virtual bool  test_file_type( const char* extension) const =0
Indicates whether a file name extension is supported. More...

Member Functions

virtual IImpexp_state* mi::​neuraylib::​IImpexp_base::create_impexp_state( const char* uri, const IImpexp_state* parent_state = 0) const [pure virtual]

Returns a state suitable for passing it to a recursive import or export call. The parameters should be used to initialize the corresponding properties of the state. The initial line number should be set to 1.

Parameters

uri
The URI of the associated file, or NULL if there is no associated file, e.g., for string-based import/export operations.
parent_state
The state of the parent importer or exporter. The parent importer or exporter is the one that called the current importer or exporter.
virtual const char* mi::​neuraylib::​IImpexp_base::get_author() const [pure virtual]

Returns a concise single-line clear text description of the author of this importer or exporter. This description may be used to support user interaction, such as in command-line help or selection boxes of graphical user interfaces. This method must return a valid string.

This description is also used in the importer or exporter selection algorithm, which selects among importers and exporters of the same name and same author the one that has the highest version number.

virtual Uint32 mi::​neuraylib::​IImpexp_base::get_major_version() const [pure virtual]

Returns the major version number of the importer or exporter. If you register multiple importers or exporters with equal name and author, the importer or exporter with the higher version number will be taken. A version number is higher if the version number is higher, or if it is equal and the minor version number is higher major (lexicographic order).

virtual Uint32 mi::​neuraylib::​IImpexp_base::get_minor_version() const [pure virtual]

Returns the minor version number of the importer or exporter. If you register multiple importers or exporters with equal name and author, the importer or exporter with the higher version number will be taken. A version number is higher if the version number is higher, or if it is equal and the minor version number is higher major (lexicographic order).

virtual const char* mi::​neuraylib::​IImpexp_base::get_name() const [pure virtual]

Returns a concise single-line clear text description of the importer or exporter. The description should name, besides maybe a product or brand name, the supported file format and, if applicable, the major file type version or versions that are supported. If a file format differs sufficiently from version to version, you may as well register different importers or exporters for each version.

This description may be used to support user interaction, such as in command-line help or selection boxes of graphical user interfaces. This method must return a valid string. This description is also used in the importer or exporter selection algorithm, which selects among importers and exporters of the same name and same author the one that has the highest version number.

virtual Impexp_priority mi::​neuraylib::​IImpexp_base::get_priority() const [pure virtual]

Returns the priority of the importer or exporter. The priority expresses the confidence of the importer or exporter that its test_file_type() method can identify the file and that the file format is fully supported.

virtual const char* mi::​neuraylib::​IImpexp_base::get_supported_extensions( Uint32 i) const [pure virtual]

Returns the i -th supported file name extension.

Returns

The file name extension including the separating dot, or NULL if i is out of range.

virtual base::​Uuid mi::​neuraylib::​IImpexp_base::get_uuid() const [pure virtual]

Returns the unique identifier for the importer or exporter. You can register only one importer or exporter for a particular UUID. If you wish to support installations with multiple versions of your importer or exporter, you have to change the UUID for each minor and major version number change.

virtual bool mi::​neuraylib::​IImpexp_base::test_file_type( const char* extension) const [pure virtual]

Indicates whether a file name extension is supported. Returns true if the importer or exporter can handle the file type determined by the file name extension. The extension is defined as the part of the file name after and including the first dot, for example, ".mi".

See also:

mi::neuraylib::IImporter::test_file_type(), mi::neuraylib::IExporter::test_file_type()

These more specific versions also pass an mi::neuraylib::IReader or mi::neuraylib::IWriter as argument, which can be used to look at lookahead data for magic file headers (readers only) or to decide if the reader or writer capabilities are sufficient to do the import or export (for example, random access capability).