22 if (node ==
nullptr || node->
GetData() ==
nullptr)
34 this->SetNthInput(0, data);
44 std::vector<std::string> possibleFileExtensions = this->GetPossibleFileExtensions();
45 std::stringstream stream;
46 for (
unsigned int i = 0; i < possibleFileExtensions.size() - 1; i++)
48 stream <<
"*" << possibleFileExtensions.at(i) <<
" ";
50 stream <<
"*" << possibleFileExtensions.at(possibleFileExtensions.size() - 1);
56 std::vector<std::string> possibleFileExtensions = this->GetPossibleFileExtensions();
57 for (
unsigned int i = 0; i < possibleFileExtensions.size(); i++)
59 if (strcmp(extension.c_str(), possibleFileExtensions.at(i).c_str()) == 0)
75 return m_CanWriteToMemory;
79 m_WriteToMemory = write;
83 return m_WriteToMemory;
87 return (
const char *)m_MemoryBuffer;
91 return m_MemoryBufferSize;
bool IsExtensionValid(std::string extension)
Checks if given extension is valid for file writer.
Base of all data objects.
virtual void SetWriteToMemory(bool write)
Set/Get functions to advise the file writer to use tis internal memory array as file writing destinat...
virtual bool CanWriteDataType(DataNode *)
Check if the Writer can write this type of data of the DataTreenode.
virtual std::string GetPossibleFileExtensionsAsString()
possible file extensions for the data type associated with the writer as string
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
void SetInput(BaseData *data)
virtual std::string GetFileExtension()
Return the extension to be added to the filename.
virtual const char * GetMemoryPointer()
To be used along with a call of SetWriteToMemory(true). This returns the memory buffer where the file...
virtual unsigned int GetMemorySize()
To be used along with a call of SetWriteToMemory(true). This returns the size of the memory buffer wh...
virtual void ReleaseMemory()
CAUTION: It's up to the user to call this function to release the memory buffer after use in case the...
virtual std::string GetWritenMIMEType()
Return the MimeType of the saved File.
virtual bool CanWriteToMemory()
Specifies, whether the file writer also can write a file to a memory buffer.
virtual bool GetWriteToMemory()
virtual std::string GetSupportedBaseData() const =0
Class for nodes of the DataTree.