X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FrtkImagXXMLFileReader.h;fp=common%2FrtkImagXXMLFileReader.h;h=1a948e2edcd29ddcab54c3db7cc258d104eaf362;hb=4c1f33fa1ab2a114f4dc94b24b0f2ef936ffafb8;hp=0000000000000000000000000000000000000000;hpb=c4a6e405914867a0abfd1ac67ebe71f3ebdeb246;p=clitk.git diff --git a/common/rtkImagXXMLFileReader.h b/common/rtkImagXXMLFileReader.h new file mode 100644 index 0000000..1a948e2 --- /dev/null +++ b/common/rtkImagXXMLFileReader.h @@ -0,0 +1,75 @@ +/*========================================================================= + * + * Copyright RTK Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *=========================================================================*/ + +#ifndef __rtkImagXXMLFileReader_h +#define __rtkImagXXMLFileReader_h + +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif + +#include +#include + +#include + +namespace rtk +{ + +/** \class ImagXXMLFileReader + * + * TODO + * + */ +class ImagXXMLFileReader : public itk::XMLReader +{ +public: + /** Standard typedefs */ + typedef ImagXXMLFileReader Self; + typedef itk::XMLReader Superclass; + typedef itk::SmartPointer Pointer; + + /** Run-time type information (and related methods). */ + itkTypeMacro(ImagXXMLFileReader, itk::XMLReader); + + /** Method for creation through the object factory. */ + itkNewMacro(Self); + + /** Determine if a file can be read */ + int CanReadFile(const char* name); + +protected: + ImagXXMLFileReader() {m_OutputObject = &m_Dictionary;} + virtual ~ImagXXMLFileReader() {} + + virtual void StartElement(const char * name,const char **atts); + + virtual void EndElement(const char *name); + + void CharacterDataHandler(const char *inData, int inLength); + +private: + ImagXXMLFileReader(const Self&); //purposely not implemented + void operator=(const Self&); //purposely not implemented + + itk::MetaDataDictionary m_Dictionary; + std::string m_CurCharacterData; +}; + +} +#endif