GDCM 3.0.24
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
21namespace gdcm
22{
23
49{
50public:
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
66private:
67 UsageType UsageField;
68};
69//-----------------------------------------------------------------------------
70inline 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
Usage.
Definition gdcmUsage.h:49
static UsageType GetUsageType(const char *type)
UsageType
Definition gdcmUsage.h:51
@ Mandatory
Definition gdcmUsage.h:52
@ UserOption
Definition gdcmUsage.h:54
@ Conditional
Definition gdcmUsage.h:53
static const char * GetUsageString(UsageType type)
Usage(UsageType type=Invalid)
Definition gdcmUsage.h:58
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88