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