21 #include "ITKIOXMLExport.h"
43 itkSetStringMacro(Filename);
46 itkGetStringMacro(Filename);
50 CanReadFile(
const char * name) = 0;
54 GenerateOutputInformation();
60 StartElement(
const char * name,
const char ** atts) = 0;
66 EndElement(
const char * name) = 0;
72 CharacterDataHandler(
const char * inData,
int inLength) = 0;
78 PrintSelf(std::ostream & os,
Indent indent)
const override;
87 std::string m_Filename{};
113 m_OutputObject = obj;
121 return m_OutputObject;
126 : m_OutputObject(nullptr)
131 T * m_OutputObject{};
144 template <
typename T>
158 itkSetStringMacro(Filename);
161 itkGetStringMacro(Filename);
165 CanWriteFile(
const char * name) = 0;
171 m_InputObject = toWrite;
178 #if !defined(ITK_WRAPPING_PARSER)
183 file << '<' << tag << '>
';
188 WriteEndElement(const char * const tag, std::ofstream & file)
190 file << '<
' << '/
' << tag << '>
';
195 WriteCharacterData(const char * const data, std::ofstream & file)
202 WriteStartElement(std::string & tag, std::ofstream & file)
204 WriteStartElement(tag.c_str(), file);
209 WriteEndElement(std::string & tag, std::ofstream & file)
211 WriteEndElement(tag.c_str(), file);
216 WriteCharacterData(std::string & data, std::ofstream & file)
218 WriteCharacterData(data.c_str(), file);
223 T * m_InputObject{}; // object to write out to an XML file
224 std::string m_Filename{}; // name of file to write.