Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMTABLEREADER_H
00016 #define GDCMTABLEREADER_H
00017
00018 #include "gdcmTypes.h"
00019 #include "gdcmDefs.h"
00020
00021
00022
00023
00024
00025 #include <string>
00026 #include <vector>
00027 #include <map>
00028
00029 namespace gdcm
00030 {
00035 class GDCM_EXPORT TableReader
00036 {
00037 public:
00038 TableReader(Defs &defs):CurrentDefs(defs),ParsingModule(false),ParsingModuleEntry(false),
00039 ParsingModuleEntryDescription(false),
00040 ParsingMacro(false),
00041 ParsingMacroEntry(false),
00042 ParsingMacroEntryDescription(false),
00043 ParsingIOD(false),
00044 ParsingIODEntry(false),
00045 Description() {}
00046 virtual ~TableReader() {}
00047
00048
00049 void SetFilename(const char *filename) { Filename = filename; }
00050 const char *GetFilename() { return Filename.c_str(); }
00051
00052 int Read();
00053
00054
00055
00056 virtual void StartElement(const char *name, const char **atts);
00057 virtual void EndElement(const char *name);
00058 virtual void CharacterDataHandler(const char *data, int length);
00059
00060 void HandleModuleEntry(const char **atts);
00061 void HandleModule(const char **atts);
00062 void HandleModuleEntryDescription(const char **atts);
00063 void HandleMacroEntry(const char **atts);
00064 void HandleMacro(const char **atts);
00065 void HandleMacroEntryDescription(const char **atts);
00066 void HandleModuleInclude(const char **atts);
00067 void HandleIODEntry(const char **atts);
00068 void HandleIOD(const char **atts);
00069
00070
00071
00072
00073 const Defs & GetDefs() const { return CurrentDefs; }
00074
00075 private:
00076 std::string Filename;
00077 Defs &CurrentDefs;
00078
00079
00080
00081 Macro CurrentMacro;
00082 Module CurrentModule;
00083 IOD CurrentIOD;
00084 MacroEntry CurrentMacroEntry;
00085 ModuleEntry CurrentModuleEntry;
00086 IODEntry CurrentIODEntry;
00087 std::string CurrentModuleName;
00088 std::string CurrentModuleRef;
00089 std::string CurrentMacroRef;
00090 bool ParsingModule;
00091 bool ParsingModuleEntry;
00092 bool ParsingModuleEntryDescription;
00093 bool ParsingMacro;
00094 bool ParsingMacroEntry;
00095 bool ParsingMacroEntryDescription;
00096 bool ParsingIOD;
00097 bool ParsingIODEntry;
00098 Tag CurrentTag;
00099 std::string Description;
00100 };
00101
00102 }
00103
00104 #endif //GDCMTABLEREADER_H