# gdcmType.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-2009 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
    00016 #ifndef __gdcmType_h
    00017 #define __gdcmType_h
    00018
    00019 #include "gdcmTypes.h"
    00020
    00021 #include <iostream>
    00022
    00023 namespace gdcm
    00024 {
    00025
    00041 class GDCM_EXPORT Type
    00042 {
    00043 public:
    00044   typedef enum {
    00045     T1 = 0,
    00046     T1C,
    00047     T2,
    00048     T2C,
    00049     T3,
    00050     UNKNOWN
    00051   } TypeType;
    00052
    00053   Type(TypeType type = UNKNOWN) : TypeField(type) { }
    00054
    00055   operator TypeType () const { return TypeField; }
    00056   friend std::ostream &operator<<(std::ostream &os, const Type &vr);
    00057
    00058   static const char *GetTypeString(TypeType type);
    00059   static TypeType GetTypeType(const char *type);
    00060
    00061 private:
    00062   TypeType TypeField;
    00063 };
    00064 //-----------------------------------------------------------------------------
    00065 inline std::ostream &operator<<(std::ostream &_os, const Type &val)
    00066 {
    00067   _os << Type::GetTypeString(val.TypeField);
    00068   return _os;
    00069 }
    00070
    00071 } // end namespace gdcm
    00072
    00073 #endif //__gdcmType_h