]> Creatis software - clitk.git/blob - common/clitkEsrfHstXMLFileReader.h
Debug RTStruct conversion with empty struc
[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 #include "clitkCommon.h"
32
33 namespace clitk
34 {
35
36 /** \class EsrfHstXMLFileReader
37  *
38  * Reads the XML-format file written by the software High Speed Tomography
39  * at the European Synchrotron Radiation Facility
40  */
41 class EsrfHstXMLFileReader : public itk::XMLReader<itk::MetaDataDictionary>
42 {
43 public:
44   /** Standard typedefs */
45   typedef EsrfHstXMLFileReader                    Self;
46   typedef itk::XMLReader<itk::MetaDataDictionary> Superclass;
47   typedef itk::SmartPointer<Self>                 Pointer;
48
49   /** Run-time type information (and related methods). */
50   itkTypeMacro(EsrfHstXMLFileReader, itk::XMLReader);
51
52   /** Method for creation through the object factory. */
53   itkNewMacro(Self);
54
55   /** Determine if a file can be read */
56   int CanReadFile(const char* name) ITK_OVERRIDE;
57
58 protected:
59   EsrfHstXMLFileReader() {m_OutputObject = &m_Dictionary;};
60   virtual ~EsrfHstXMLFileReader() {};
61
62   virtual void StartElement(const char * name,const char **atts) ITK_OVERRIDE;
63
64   virtual void EndElement(const char *name) ITK_OVERRIDE;
65
66   void CharacterDataHandler(const char *inData, int inLength) ITK_OVERRIDE;
67
68 private:
69   EsrfHstXMLFileReader(const Self&); //purposely not implemented
70   void operator=(const Self&);       //purposely not implemented
71
72   itk::MetaDataDictionary m_Dictionary;
73   std::string             m_CurCharacterData;
74 };
75
76 }
77 #endif