gdcmTableReader.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMTABLEREADER_H
#define GDCMTABLEREADER_H
#include "gdcmTypes.h"
#include "gdcmDefs.h"
//#include "gdcmModule.h"
//#include "gdcmIOD.h"
//#include "gdcmIODs.h"
//#include "gdcmModules.h"
#include <string>
#include <vector>
#include <map>
namespace gdcm
{
class GDCM_EXPORT TableReader
{
public:
TableReader(Defs &defs):CurrentDefs(defs),ParsingModule(false),ParsingModuleEntry(false),
ParsingModuleEntryDescription(false),
ParsingMacro(false),
ParsingMacroEntry(false),
ParsingMacroEntryDescription(false),
ParsingIOD(false),
ParsingIODEntry(false),
Description() {}
virtual ~TableReader() = default;
// Set/Get filename
void SetFilename(const char *filename) { Filename = filename; }
const char *GetFilename() { return Filename.c_str(); }
int Read();
//protected:
// You need to override those function in your subclasses:
virtual void StartElement(const char *name, const char **atts);
virtual void EndElement(const char *name);
virtual void CharacterDataHandler(const char *data, int length);
void HandleModuleEntry(const char **atts);
void HandleModule(const char **atts);
void HandleModuleEntryDescription(const char **atts);
void HandleMacroEntry(const char **atts);
void HandleMacro(const char **atts);
void HandleMacroEntryDescription(const char **atts);
void HandleModuleInclude(const char **atts);
void HandleIODEntry(const char **atts);
void HandleIOD(const char **atts);
//const Modules & GetModules() const { return CurrentModules; }
//const Macros & GetMacros() const { return CurrentMacros; }
//const IODs & GetIODs() const { return CurrentIODs; }
const Defs & GetDefs() const { return CurrentDefs; }
private:
std::string Filename;
Defs &CurrentDefs;
//Macros CurrentMacros;
//Modules CurrentModules;
//IODs CurrentIODs;
Macro CurrentMacro;
Module CurrentModule;
IOD CurrentIOD;
MacroEntry CurrentMacroEntry;
ModuleEntry CurrentModuleEntry;
IODEntry CurrentIODEntry;
std::string CurrentModuleName;
std::string CurrentModuleRef;
std::string CurrentMacroRef;
bool ParsingModule;
bool ParsingModuleEntry;
bool ParsingModuleEntryDescription;
bool ParsingMacro;
bool ParsingMacroEntry;
bool ParsingMacroEntryDescription;
bool ParsingIOD;
bool ParsingIODEntry;
Tag CurrentTag;
std::string Description;
};
} // end namespace gdcm
#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