neuray API Programmer's Manual

mi::neuraylib::IImpexp_state Class Reference

[Importer and Exporter]

Description

This interface represents states that are passed to recursive calls of importers and exporters. It carries all state information that a recursive importer call may need to access from its calling importer, such as the URI and the current line number. It is, for example, used to provide proper diagnostics. The class implementing the state needs to be derived from this mi::neuraylib::IImpexp_state class.

Importer and exporter classes have a factory function to create the state object. This allows the calling function to create a state, initialize it and querying the number of lines imported after running the actual importer.

Importers and exporters can enrich their implementation of the state with additional information they may need to import or export specific formats recursively.

Public Member Functions

virtual Uint32 get_line_number() const =0
Returns the line number after the last read or write operation. More...
virtual const IImpexp_stateget_parent_state() const =0
Returns the state of the parent importer or exporter. More...
virtual const char* get_uri() const =0
Returns the URI for this file. More...
virtual void incr_line_number() =0
Convenience function that increments the line number by one. More...
virtual void set_line_number( Uint32 n) =0
Sets the line number to n. More...

Member Functions

virtual Uint32 mi::​neuraylib::​IImpexp_state::get_line_number() const [pure virtual]

Returns the line number after the last read or write operation. Line number counting starts with 1 for the first line. Only applicable for line oriented file formats.

virtual const IImpexp_state* mi::​neuraylib::​IImpexp_state::get_parent_state() const [pure virtual]

Returns the state of the parent importer or exporter. The parent importer or exporter is the one that called the current importer or exporter. Returns NULL if there is no parent importer or exporter.

virtual const char* mi::​neuraylib::​IImpexp_state::get_uri() const [pure virtual]

Returns the URI for this file.

Returns

The URI of the associated file, or NULL if there is no associated file, e.g., for string-based import/export operations.

virtual void mi::​neuraylib::​IImpexp_state::incr_line_number() [pure virtual]

Convenience function that increments the line number by one. Line number counting starts with 1 for the first line.

virtual void mi::​neuraylib::​IImpexp_state::set_line_number( Uint32 n) [pure virtual]

Sets the line number to n. Line number counting starts with 1 for the first line.