GDCM 3.2.1

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
gdcm::Usage
Usage.
Definition gdcmUsage.h:49
gdcm::Usage::GetUsageType
static UsageType GetUsageType(const char *type)
gdcm::Usage::UsageType
UsageType
Definition gdcmUsage.h:51
gdcm::Usage::Invalid
@ Invalid
Definition gdcmUsage.h:55
gdcm::Usage::Mandatory
@ Mandatory
Definition gdcmUsage.h:52
gdcm::Usage::UserOption
@ UserOption
Definition gdcmUsage.h:54
gdcm::Usage::Conditional
@ Conditional
Definition gdcmUsage.h:53
gdcm::Usage::GetUsageString
static const char * GetUsageString(UsageType type)
gdcm::Usage::Usage
Usage(UsageType type=Invalid)
Definition gdcmUsage.h:58
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88