![]() |
Mapper
0.9.0
API documentation
|
Abstract base class for both importer and exporters. More...
#include <file_import_export.h>
Public Member Functions | |
ImportExport (QIODevice *device=nullptr) | |
Creates a new importer or exporter with the given IO device. More... | |
ImportExport (const ImportExport &)=delete | |
ImportExport (ImportExport &&)=delete | |
virtual | ~ImportExport () |
Destroys an importer or exporter. More... | |
virtual bool | supportsQIODevice () const noexcept |
Returns true when the importer/exporter supports QIODevice. More... | |
QIODevice * | device () const noexcept |
Returns the input device if it has been set or created. More... | |
void | setDevice (QIODevice *device) |
Sets a custom input device to be used for import. More... | |
void | setOption (const QString &name, const QVariant &value) |
Sets an option in this importer or exporter. More... | |
QVariant | option (const QString &name) const |
Retrieves the value of an option in this instance. More... | |
void | addWarning (const QString &str) |
Adds a string to the current list of warnings. More... | |
const std::vector< QString > & | warnings () const noexcept |
Returns the current list of warnings collected by this object. More... | |
Friends | |
class | Exporter |
class | Importer |
Abstract base class for both importer and exporters.
This class provides support for setting and retrieving options, for collecting a list of warnings, and for storing a final error message.
Subclass constructors need to define default values for options they use, by calling setOption().
|
inline |
Creates a new importer or exporter with the given IO device.
|
delete |
|
delete |
|
virtualdefault |
Destroys an importer or exporter.
|
inline |
Adds a string to the current list of warnings.
The provided message should be translated.
|
inlinenoexcept |
Returns the input device if it has been set or created.
Retrieves the value of an option in this instance.
The option's value must have been set before this function is called, either in the constructor, or later through setOption(). Otherwise a FormatException will be thrown.
void OpenOrienteering::ImportExport::setDevice | ( | QIODevice * | device | ) |
Sets a custom input device to be used for import.
Not all importers may be able to use such devices.
Sets an option in this importer or exporter.
|
virtualnoexcept |
Returns true when the importer/exporter supports QIODevice.
The default implementation returns true
. Some exporters or importers might wish to use other ways of accessing the output/input path. In these cases, the default implementation should be overwritten to return false
.
Reimplemented in OpenOrienteering::OgrFileExport, and OpenOrienteering::OgrFileImport.
|
inlinenoexcept |
Returns the current list of warnings collected by this object.
|
friend |
|
friend |