33#include <NDEVR/IOFactory.h>
34#include <NDEVR/File.h>
35#include <NDEVR/FactoryOptions.h>
The equivelent of std::vector but with a bit more control.
A core class where all Design Objects including models, materials, and geometries are stored.
A hash-based key-value store, useful for quick associative lookups.
Allows IOFactories to report what features they support to make the import/export dialogs easier to s...
User-defined options that define preferences for importing and exporting using IOFactory objects.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
IOFactory(const StringView &factory_name)
Constructs an IOFactory with the given factory name.
void addToFormatPriority(UUID format, sint04 priority)
Adjusts the priority of a file format identified by its UUID.
virtual void getSupportedFormatsByModelType(Buffer< FileFormat > &formats, bool is_read, const StringView &model_type) override
Populates a buffer with all supported file formats filtered by model type.
virtual Buffer< UUID > filterModelsToExport(Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, const FileFormat &export_format) const override
Filters a set of model UUIDs to only those that can be exported in the given format.
void clearFactories()
Removes all registered IOFactory instances from this ModelFactory.
virtual void getSupportedFormats(Buffer< FileFormat > &formats, bool is_read) override
Populates a buffer with all supported file formats for reading or writing, aggregated from all regist...
Dictionary< String, String > m_extension_read_passwords
Read passwords keyed by file extension.
void enableFactory(const StringView &factory, const StringView &read_password, const StringView &write_password)
Enables read/write access for a named factory using password-based authorization.
virtual void getSupportedFormats(Buffer< FileFormat > &formats, const File &file) override
Populates a buffer with all supported file formats that can handle the given file,...
void addToFormatPriority(const StringView &extension, sint04 priority)
Adjusts the priority of a file format identified by its file extension.
virtual bool canRead(const File &file) override
Checks whether any registered factory can read the given file.
void addFactory(StringView extension, IOFactory *factory)
Registers an IOFactory for a specific file extension.
Dictionary< String, IOFactory * > m_named_factories
Factories indexed by factory name.
virtual bool canWrite(const FactoryParameters &file) override
Checks whether any registered factory can write the given file described by FactoryParameters.
void sortFormats(Buffer< FileFormat > &formats)
Sorts the given buffer of file formats according to the current priority settings.
virtual FactoryOptions defaultReadOptions(const FactoryParameters &file) const override
Retrieves the default read options for the given file from the appropriate registered factory.
Dictionary< String, String > m_extension_write_passwords
Write passwords keyed by file extension.
void enableExtension(StringView extension, const StringView &read_password, const StringView &write_password)
Enables read/write access for a specific file extension using password-based authorization.
void addFactory(IOFactory *factory)
Registers an IOFactory to be used for import/export operations.
virtual bool canRead(const FactoryParameters &file) override
Checks whether any registered factory can read the given file described by FactoryParameters.
virtual bool readFile(FactoryParameters &file) override
Reads the given file by delegating to the appropriate registered IOFactory.
virtual bool canWrite(const File &file) override
Checks whether any registered factory can write the given file.
virtual void getSupportedFormats(Buffer< FileFormat > &formats, DesignObjectLookup *lookup, const Buffer< UUID > &models) override
Populates a buffer with all supported file formats that can export the specified models.
virtual String getIcon(const File &file) override
Retrieves the icon name associated with the given file type.
static ModelFactory & DefaultFactory()
Retrieves the singleton ModelFactory instance.
Buffer< IOFactory * > * m_factory_objects
Collection of all registered IOFactory instances.
Dictionary< UUID, sint04 > m_id_priority_modification
Per-format priority adjustments keyed by format UUID.
virtual bool updateFromFile(const FactoryParameters &file, const FactoryOptions &old_options) override
Updates existing data from the file, using the previous options for context.
~ModelFactory()
Destructs the ModelFactory and releases all registered factory references.
ModelFactory()
Constructs the ModelFactory.
virtual bool writeFile(FactoryParameters &file) override
Writes the given file by delegating to the appropriate registered IOFactory.
void enableFactory(IOFactory *factory, const StringView &read_password, const StringView &write_password)
Enables read/write access for a specific IOFactory instance using password-based authorization.
virtual FactoryOptions defaultWriteOptions(const FactoryParameters &file) const override
Retrieves the default write options for the given file from the appropriate registered factory.
virtual bool determineExtension(const File &file, String &extension) override
Attempts to determine the file extension for the given file by querying registered factories.
FactoryFeatures factoryFeatures(const FactoryParameters &file, bool is_import) const override
Retrieves the feature flags describing the capabilities of the factory for the given file.
Dictionary< String, Buffer< IOFactory * > > m_extension_factories
Factories indexed by file extension string.
Software Service Managers take a Software service to modify the behavior of the software.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.
int32_t sint04
-Defines an alias representing a 4 byte, signed integer.
A container of input information that is to be filled with output information by an IOFactory.