gdcmUsage.h

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

Generated on Sat Dec 4 2010 08:58:48 for GDCM by doxygen 1.7.2
SourceForge.net Logo