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;
81 void operator=(
const Self &);
115 void operator=(
const Self &);
142 itkSetStringMacro(Filename);
145 itkGetStringMacro(Filename);
148 virtual int CanWriteFile(
const char *name) = 0;
154 virtual int WriteFile() = 0;
157 void WriteStartElement(
const char *
const tag, std::ofstream & file)
159 file << '<' << tag << '>
';
163 void WriteEndElement(const char *const tag, std::ofstream & file)
165 file << '<
' << '/
' << tag << '>
';
169 void WriteCharacterData(const char *const data, std::ofstream & file)
175 void WriteStartElement(std::string & tag, std::ofstream & file)
177 WriteStartElement(tag.c_str(), file);
181 void WriteEndElement(std::string & tag, std::ofstream & file)
183 WriteEndElement(tag.c_str(), file);
187 void WriteCharacterData(std::string & data, std::ofstream & file)
189 WriteCharacterData(data.c_str(), file);
193 T *m_InputObject; // object to write out to an XML file
194 std::string m_Filename; // name of file to write.
197 XMLWriterBase(const Self &); //purposely not implemented
198 void operator=(const Self &); //purposely not implemented