18 #ifndef __itkXMLFile_h
19 #define __itkXMLFile_h
40 itkSetStringMacro(Filename);
43 itkGetStringMacro(Filename);
46 virtual int CanReadFile(
const char *name) = 0;
49 virtual void GenerateOutputInformation();
54 virtual void StartElement(
const char *name,
const char **atts) = 0;
59 virtual void EndElement(
const char *name) = 0;
64 virtual void CharacterDataHandler(
const char *inData,
int inLength) = 0;
69 void PrintSelf(std::ostream & os,
Indent indent)
const;
80 void operator=(
const Self &);
113 void operator=(
const Self &);
140 itkSetStringMacro(Filename);
143 itkGetStringMacro(Filename);
146 virtual int CanWriteFile(
const char *name) = 0;
152 virtual int WriteFile() = 0;
155 void WriteStartElement(
const char *
const tag, std::ofstream & file)
157 file << '<' << tag << '>
';
161 void WriteEndElement(const char *const tag, std::ofstream & file)
163 file << '<
' << '/
' << tag << '>
';
167 void WriteCharacterData(const char *const data, std::ofstream & file)
173 void WriteStartElement(std::string & tag, std::ofstream & file)
175 WriteStartElement(tag.c_str(), file);
179 void WriteEndElement(std::string & tag, std::ofstream & file)
181 WriteEndElement(tag.c_str(), file);
185 void WriteCharacterData(std::string & data, std::ofstream & file)
187 WriteCharacterData(data.c_str(), file);
191 T *m_InputObject; // object to write out to an XML file
192 std::string m_Filename; // name of file to write.
194 XMLWriterBase(const Self &); //purposely not implemented
195 void operator=(const Self &); //purposely not implemented