]> Creatis software - clitk.git/blob - common/clitkEsrfHstXMLFileReader.h
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / common / clitkEsrfHstXMLFileReader.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18
19 #ifndef __clitkEsrfHstXMLFileReader_h
20 #define __clitkEsrfHstXMLFileReader_h
21
22 #ifdef _MSC_VER
23 #pragma warning ( disable : 4786 )
24 #endif
25
26 #include <itkXMLFile.h>
27 #include <itkMetaDataDictionary.h>
28
29 #include <map>
30
31 namespace clitk
32 {
33
34 /** \class EsrfHstXMLFileReader
35  *
36  * Reads the XML-format file written by the software High Speed Tomography
37  * at the European Synchrotron Radiation Facility
38  */
39 class EsrfHstXMLFileReader : public itk::XMLReader<itk::MetaDataDictionary>
40 {
41 public:
42   /** Standard typedefs */
43   typedef EsrfHstXMLFileReader                    Self;
44   typedef itk::XMLReader<itk::MetaDataDictionary> Superclass;
45   typedef itk::SmartPointer<Self>                 Pointer;
46
47   /** Run-time type information (and related methods). */
48   itkTypeMacro(EsrfHstXMLFileReader, itk::XMLReader);
49
50   /** Method for creation through the object factory. */
51   itkNewMacro(Self);
52
53   /** Determine if a file can be read */
54   int CanReadFile(const char* name);
55
56 protected:
57   EsrfHstXMLFileReader() {m_OutputObject = &m_Dictionary;};
58   virtual ~EsrfHstXMLFileReader() {};
59
60   virtual void StartElement(const char * name,const char **atts);
61
62   virtual void EndElement(const char *name);
63
64   void CharacterDataHandler(const char *inData, int inLength);
65
66 private:
67   EsrfHstXMLFileReader(const Self&); //purposely not implemented
68   void operator=(const Self&);       //purposely not implemented
69
70   itk::MetaDataDictionary m_Dictionary;
71   std::string             m_CurCharacterData;
72 };
73
74 }
75 #endif