GDCM 3.2.1

gdcmTableReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
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 above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMTABLEREADER_H
15#define GDCMTABLEREADER_H
16
17#include "gdcmTypes.h"
18#include "gdcmDefs.h"
19//#include "gdcmModule.h"
20//#include "gdcmIOD.h"
21//#include "gdcmIODs.h"
22//#include "gdcmModules.h"
23
24#include <string>
25#include <vector>
26#include <map>
27
28 namespace gdcm
29{
34 class GDCM_EXPORT TableReader
35{
36 public:
37 TableReader(Defs &defs):CurrentDefs(defs),ParsingModule(false),ParsingModuleEntry(false),
38 ParsingModuleEntryDescription(false),
39 ParsingMacro(false),
40 ParsingMacroEntry(false),
41 ParsingMacroEntryDescription(false),
42 ParsingIOD(false),
43 ParsingIODEntry(false),
44 Description() {}
45 virtual ~TableReader() = default;
46
47 // Set/Get filename
48 void SetFilename(const char *filename) { Filename = filename; }
49 const char *GetFilename() { return Filename.c_str(); }
50
51 int Read();
52
53//protected:
54 // You need to override those function in your subclasses:
55 virtual void StartElement(const char *name, const char **atts);
56 virtual void EndElement(const char *name);
57 virtual void CharacterDataHandler(const char *data, int length);
58
59 void HandleModuleEntry(const char **atts);
60 void HandleModule(const char **atts);
61 void HandleModuleEntryDescription(const char **atts);
62 void HandleMacroEntry(const char **atts);
63 void HandleMacro(const char **atts);
64 void HandleMacroEntryDescription(const char **atts);
65 void HandleModuleInclude(const char **atts);
66 void HandleIODEntry(const char **atts);
67 void HandleIOD(const char **atts);
68
69 //const Modules & GetModules() const { return CurrentModules; }
70 //const Macros & GetMacros() const { return CurrentMacros; }
71 //const IODs & GetIODs() const { return CurrentIODs; }
72 const Defs & GetDefs() const { return CurrentDefs; }
73
74 private:
75 std::string Filename;
76 Defs &CurrentDefs;
77 //Macros CurrentMacros;
78 //Modules CurrentModules;
79 //IODs CurrentIODs;
80 Macro CurrentMacro;
81 Module CurrentModule;
82 IOD CurrentIOD;
83 MacroEntry CurrentMacroEntry;
84 ModuleEntry CurrentModuleEntry;
85 IODEntry CurrentIODEntry;
86 std::string CurrentModuleName;
87 std::string CurrentModuleRef;
88 std::string CurrentMacroRef;
89 bool ParsingModule;
90 bool ParsingModuleEntry;
91 bool ParsingModuleEntryDescription;
92 bool ParsingMacro;
93 bool ParsingMacroEntry;
94 bool ParsingMacroEntryDescription;
95 bool ParsingIOD;
96 bool ParsingIODEntry;
97 Tag CurrentTag;
98 std::string Description;
99};
100
101} // end namespace gdcm
102
103#endif //GDCMTABLEREADER_H
gdcm::Defs
FIXME I do not like the name 'Defs'.
Definition gdcmDefs.h:33
gdcm::Filename
Class to manipulate file name's.
Definition gdcmFilename.h:28
gdcm::IODEntry
Class for representing a IODEntry.
Definition gdcmIODEntry.h:52
gdcm::IOD
Class for representing a IOD.
Definition gdcmIOD.h:35
gdcm::Macro
Class for representing a Macro.
Definition gdcmMacro.h:37
gdcm::ModuleEntry
Class for representing a ModuleEntry.
Definition gdcmModuleEntry.h:30
gdcm::Module
Class for representing a Module.
Definition gdcmModule.h:38
gdcm::TableReader::EndElement
virtual void EndElement(const char *name)
gdcm::TableReader::SetFilename
void SetFilename(const char *filename)
Definition gdcmTableReader.h:48
gdcm::TableReader::StartElement
virtual void StartElement(const char *name, const char **atts)
gdcm::TableReader::TableReader
TableReader(Defs &defs)
Definition gdcmTableReader.h:37
gdcm::TableReader::HandleModuleEntry
void HandleModuleEntry(const char **atts)
gdcm::TableReader::Read
int Read()
gdcm::TableReader::GetFilename
const char * GetFilename()
Definition gdcmTableReader.h:49
gdcm::TableReader::HandleIOD
void HandleIOD(const char **atts)
gdcm::TableReader::HandleIODEntry
void HandleIODEntry(const char **atts)
gdcm::TableReader::~TableReader
virtual ~TableReader()=default
gdcm::TableReader::CharacterDataHandler
virtual void CharacterDataHandler(const char *data, int length)
gdcm::TableReader::HandleMacro
void HandleMacro(const char **atts)
gdcm::TableReader::HandleModule
void HandleModule(const char **atts)
gdcm::TableReader::GetDefs
const Defs & GetDefs() const
Definition gdcmTableReader.h:72
gdcm::TableReader::HandleModuleEntryDescription
void HandleModuleEntryDescription(const char **atts)
gdcm::TableReader::HandleMacroEntryDescription
void HandleMacroEntryDescription(const char **atts)
gdcm::TableReader::HandleModuleInclude
void HandleModuleInclude(const char **atts)
gdcm::TableReader::HandleMacroEntry
void HandleMacroEntry(const char **atts)
gdcm::Tag
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
gdcmDefs.h
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::MacroEntry
ModuleEntry MacroEntry
Definition gdcmModuleEntry.h:72