18#ifndef __vtkMRMLFileIOHandler_h
19#define __vtkMRMLFileIOHandler_h
22#include "vtkMRMLLogicExport.h"
28#include <vtkWeakPointer.h>
46 void PrintSelf(ostream& os, vtkIndent indent)
override;
80 virtual bool IsWriter()
const {
return false; }
120 const std::vector<std::string>& nameFilters,
121 bool requireReadableFile,
122 int* longestExtensionMatch =
nullptr);
129 static bool WildcardMatch(
const std::string& pattern,
const std::string& text);
vtkMRMLMessageCollection * GetUserMessages() const
std::string GetOptionsDescriptionJSON(vtkMRMLIOProperties *properties)
void SetNameFilters(const std::vector< std::string > &filters)
The name filters, as Slicer writes them: "Mimics project (*.mcs *.mcs.gz)".
virtual void GetOptionsDescription(vtkMRMLIOOptionsDescription *description)
static std::string LongestMatchingExtension(const std::string &filePath, const std::vector< std::string > &extensions)
void GetOptionValues(vtkMRMLIOProperties *properties, vtkMRMLIOProperties *values)
vtkMRMLFileIOManager * GetFileIOManager() const
static std::vector< std::string > GetMatchingNameFilters(const std::string &filePath, const std::vector< std::string > &nameFilters, bool requireReadableFile, int *longestExtensionMatch=nullptr)
std::vector< std::string > NameFilters
virtual bool IsWriter() const
Whether this writes rather than reads.
vtkMRMLScene * GetScene() const
vtkNew< vtkMRMLIOProperties > OptionDefaults
static vtkMRMLFileIOHandler * New()
const std::vector< std::string > & GetNameFilters() const
std::vector< std::string > Extensions
virtual std::string GetMatchedExtension(const std::string &filePath) const
The longest matching extension of filePath, or an empty string.
vtkNew< vtkMRMLMessageCollection > UserMessages
virtual void SetScene(vtkMRMLScene *scene)
Where the nodes go, and where messages for the user are collected.
static bool WildcardMatch(const std::string &pattern, const std::string &text)
Case-insensitive wildcard matching of the whole text. Supported wildcards: '*', '?...
virtual bool MatchesExtension(const std::string &filePath) const
void SetFileIOManager(vtkMRMLFileIOManager *manager)
vtkMRMLIOProperties * GetOptionDefaults()
static std::vector< std::string > NameFilterToWildcards(const std::string &nameFilter)
void PrintSelf(ostream &os, vtkIndent indent) override
vtkWeakPointer< vtkMRMLFileIOManager > FileIOManager
const std::vector< std::string > & GetExtensions() const
vtkWeakPointer< vtkMRMLScene > Scene
void FillOptionsDescription(vtkMRMLIOProperties *properties, vtkMRMLIOOptionsDescription *description)
~vtkMRMLFileIOHandler() override
static std::vector< std::string > ExtensionsFromNameFilter(const std::string &nameFilter)
The extensions named by a filter such as "Mimics project (*.mcs *.mcs.gz)".
A set of MRML Nodes that supports serialization and undo/redo.