GDCM
2.2.0
|
00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 00005 Copyright (c) 2006-2011 Mathieu Malaterre 00006 All rights reserved. 00007 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 #ifndef GDCMUSAGE_H 00015 #define GDCMUSAGE_H 00016 00017 #include "gdcmTypes.h" 00018 00019 #include <iostream> 00020 00021 namespace gdcm 00022 { 00023 00048 class GDCM_EXPORT Usage 00049 { 00050 public: 00051 typedef enum { 00052 Mandatory, // (see A.1.3.1) , abbreviated M 00053 Conditional, // (see A.1.3.2) , abbreviated C 00054 UserOption, // (see A.1.3.3) , abbreviated U 00055 Invalid 00056 } UsageType; 00057 00058 Usage(UsageType type = Invalid) : UsageField(type) { } 00059 00060 operator UsageType () const { return UsageField; } 00061 friend std::ostream &operator<<(std::ostream &os, const Usage &vr); 00062 00063 static const char *GetUsageString(UsageType type); 00064 static UsageType GetUsageType(const char *type); 00065 00066 private: 00067 UsageType UsageField; 00068 }; 00069 //----------------------------------------------------------------------------- 00070 inline std::ostream &operator<<(std::ostream &_os, const Usage &val) 00071 { 00072 _os << Usage::GetUsageString(val.UsageField); 00073 return _os; 00074 } 00075 00076 } // end namespace gdcm 00077 00078 #endif //GDCMUSAGE_H