GDCM  2.2.3
gdcmTableReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program: GDCM (Grassroots DICOM). A DICOM library
00004 
00005   Copyright (c) 2006-2011 Mathieu Malaterre
00006   All rights reserved.
00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00014 #ifndef GDCMTABLEREADER_H
00015 #define GDCMTABLEREADER_H
00016 
00017 #include "gdcmTypes.h"
00018 #include "gdcmDefs.h"
00019 //#include "gdcmModule.h"
00020 //#include "gdcmIOD.h"
00021 //#include "gdcmIODs.h"
00022 //#include "gdcmModules.h"
00023 
00024 #include <string>
00025 #include <vector>
00026 #include <map>
00027 
00028 namespace gdcm
00029 {
00034 class GDCM_EXPORT TableReader
00035 {
00036 public:
00037   TableReader(Defs &defs):CurrentDefs(defs),ParsingModule(false),ParsingModuleEntry(false),
00038   ParsingModuleEntryDescription(false),
00039   ParsingMacro(false),
00040   ParsingMacroEntry(false),
00041   ParsingMacroEntryDescription(false),
00042   ParsingIOD(false),
00043   ParsingIODEntry(false),
00044   Description() {}
00045   virtual ~TableReader() {}
00046 
00047   // Set/Get filename
00048   void SetFilename(const char *filename) { Filename = filename; }
00049   const char *GetFilename() { return Filename.c_str(); }
00050 
00051   int Read();
00052 
00053 //protected:
00054   // You need to override those function in your subclasses:
00055   virtual void StartElement(const char *name, const char **atts);
00056   virtual void EndElement(const char *name);
00057   virtual void CharacterDataHandler(const char *data, int length);
00058 
00059 void HandleModuleEntry(const char **atts);
00060 void HandleModule(const char **atts);
00061 void HandleModuleEntryDescription(const char **atts);
00062 void HandleMacroEntry(const char **atts);
00063 void HandleMacro(const char **atts);
00064 void HandleMacroEntryDescription(const char **atts);
00065 void HandleModuleInclude(const char **atts);
00066 void HandleIODEntry(const char **atts);
00067 void HandleIOD(const char **atts);
00068 
00069   //const Modules & GetModules() const { return CurrentModules; }
00070   //const Macros & GetMacros() const { return CurrentMacros; }
00071   //const IODs & GetIODs() const { return CurrentIODs; }
00072   const Defs & GetDefs() const { return CurrentDefs; }
00073 
00074 private:
00075   std::string Filename;
00076   Defs &CurrentDefs;
00077   //Macros CurrentMacros;
00078   //Modules CurrentModules;
00079   //IODs CurrentIODs;
00080   Macro CurrentMacro;
00081   Module CurrentModule;
00082   IOD CurrentIOD;
00083   MacroEntry CurrentMacroEntry;
00084   ModuleEntry CurrentModuleEntry;
00085   IODEntry CurrentIODEntry;
00086   std::string CurrentModuleName;
00087   std::string CurrentModuleRef;
00088   std::string CurrentMacroRef;
00089   bool ParsingModule;
00090   bool ParsingModuleEntry;
00091   bool ParsingModuleEntryDescription;
00092   bool ParsingMacro;
00093   bool ParsingMacroEntry;
00094   bool ParsingMacroEntryDescription;
00095   bool ParsingIOD;
00096   bool ParsingIODEntry;
00097   Tag CurrentTag;
00098   std::string Description;
00099 };
00100 
00101 } // end namespace gdcm
00102 
00103 #endif //GDCMTABLEREADER_H

Generated on Thu Nov 28 2013 07:02:50 for GDCM by doxygen 1.7.6.1
SourceForge.net Logo