GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

gdcmDictConverter.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
15 #ifndef GDCMDICTCONVERTER_H
16 #define GDCMDICTCONVERTER_H
17
18 #include "gdcmTypes.h"
19 #include "gdcmVR.h"
20 #include "gdcmVM.h"
21
22 #include <string>
23
24 namespace gdcm
25 {
26
27 class DictConverterInternal;
35 class GDCM_EXPORT DictConverter
36 {
37 public:
38 DictConverter();
39 ~DictConverter();
40 void SetInputFileName(const char* filename);
41 const std::string &GetInputFilename() const;
42 void SetOutputFileName(const char* filename);
43 const std::string &GetOutputFilename() const;
44
45 int GetOutputType() const {
46 return OutputType;
47 }
48 void SetOutputType(int type) {
49 OutputType = type;
50 }
51 const std::string &GetDictName() const;
52 void SetDictName(const char *name);
53
54 void Convert();
55
56 // Leaving them public for now. Not really user oriented but may be
57 // usefull
58 static bool ReadVR(const char *raw, VR::VRType &type);
59 static bool ReadVM(const char *raw, VM::VMType &type);
60 static bool Readuint16(const char *raw, uint16_t &ov);
61
62 enum OutputTypes {
63 DICT_DEFAULT = 0,
64 DICT_DEBUG,
65 DICT_XML
66 };
67
68 protected:
69 void WriteHeader();
70 void WriteFooter();
71 bool ConvertToXML(const char *raw, std::string &cxx);
72 bool ConvertToCXX(const char *raw, std::string &cxx);
73 void AddGroupLength();
74
75 private:
76 DictConverterInternal *Internal;
77
78 int OutputType;
79 };
80
81 } // end namespace gdcm
82
83 #endif //GDCMDICTCONVERTER_H