GDCM 2.2.1

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

- File List
- File Members

gdcmUsage.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 GDCMUSAGE_H
15 #define GDCMUSAGE_H
16
17 #include "gdcmTypes.h"
18
19 #include <iostream>
20
21 namespace gdcm
22 {
23
48 class GDCM_EXPORT Usage
49 {
50 public:
51 typedef enum {
52 Mandatory, // (see A.1.3.1) , abbreviated M
53 Conditional, // (see A.1.3.2) , abbreviated C
54 UserOption, // (see A.1.3.3) , abbreviated U
55 Invalid
56 } UsageType;
57
58 Usage(UsageType type = Invalid) : UsageField(type) { }
59
60 operator UsageType () const { return UsageField; }
61 friend std::ostream &operator<<(std::ostream &os, const Usage &vr);
62
63 static const char *GetUsageString(UsageType type);
64 static UsageType GetUsageType(const char *type);
65
66 private:
67 UsageType UsageField;
68 };
69 //-----------------------------------------------------------------------------
70 inline std::ostream &operator<<(std::ostream &_os, const Usage &val)
71 {
72 _os << Usage::GetUsageString(val.UsageField);
73 return _os;
74 }
75
76 } // end namespace gdcm
77
78 #endif //GDCMUSAGE_H