A abstract base class for all file writers.
More...
#include <datawriter.h>
|
| DataWriter (const DataWriter &rhs) |
|
DataWriter & | operator= (const DataWriter &that) |
|
| DataWriter (DataWriter &&rhs) noexcept=default |
|
DataWriter & | operator= (DataWriter &&that) noexcept=default |
|
virtual DataWriter * | clone () const =0 |
|
const std::vector< FileExtension > & | getExtensions () const |
|
void | addExtension (FileExtension ext) |
|
Overwrite | getOverwrite () const |
|
void | setOverwrite (Overwrite val) |
|
void | checkOverwrite (const std::filesystem::path &path) const |
|
virtual bool | setOption (std::string_view key, std::any value) |
| Set writer specific options See the documentation of the specific writer for the available options.
|
|
virtual std::any | getOption (std::string_view key) const |
| Query the value of a writer specific option.
|
|
template<typename T > |
bool | writesType () const |
|
|
static void | checkOverwrite (const std::filesystem::path &path, Overwrite overwrite) |
|
|
std::ofstream | open (const std::filesystem::path &path, std::ios_base::openmode mode=std::ios_base::out) const |
|
virtual bool | canWrite (const std::type_index &index) const =0 |
|
◆ checkOverwrite() [1/2]
void inviwo::DataWriter::checkOverwrite |
( |
const std::filesystem::path & | path | ) |
const |
Verify that you don't overwrite path
unless overwrite
is Yes
.
- Exceptions
-
◆ checkOverwrite() [2/2]
static void inviwo::DataWriter::checkOverwrite |
( |
const std::filesystem::path & | path, |
|
|
Overwrite | overwrite ) |
|
static |
Verify that you don't overwrite path
unless overwrite
is Yes
.
- Exceptions
-
◆ getOption()
virtual std::any inviwo::DataWriter::getOption |
( |
std::string_view | key | ) |
const |
|
inlinevirtual |
Query the value of a writer specific option.
- Parameters
-
- Returns
- an std::any with the requested option or an empty std::any if the option was not found
◆ open()
std::ofstream inviwo::DataWriter::open |
( |
const std::filesystem::path & | path, |
|
|
std::ios_base::openmode | mode = std::ios_base::out ) const |
|
protected |
Open path
in mode
for writing. If the overwrite condition is broken or the file can't be opened an exception is thrown.
- Exceptions
-
◆ setOption()
virtual bool inviwo::DataWriter::setOption |
( |
std::string_view | key, |
|
|
std::any | value ) |
|
inlinevirtual |
Set writer specific options See the documentation of the specific writer for the available options.
- Parameters
-
key | the option to set |
value | the new value for the option |
- Returns
- true if the option was recognized and set, otherwise false
The documentation for this class was generated from the following file: