Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMSWAPCODE_H
00016 #define GDCMSWAPCODE_H
00017
00018 #include "gdcmTypes.h"
00019 #include <iostream>
00020
00021 namespace gdcm
00022 {
00023
00028 class GDCM_EXPORT SwapCode
00029 {
00030 public:
00031 typedef enum {
00032 Unknown = 0,
00033 LittleEndian = 1234,
00034 BigEndian = 4321,
00035 BadLittleEndian = 3412,
00036 BadBigEndian = 2143
00037 } SwapCodeType;
00038
00039 operator SwapCode::SwapCodeType() const { return SwapCodeValue; }
00040 SwapCode(SwapCodeType sc = Unknown):SwapCodeValue(sc) { }
00041 static const char* GetSwapCodeString(SwapCode const & sc);
00042
00043 friend std::ostream& operator<<(std::ostream& os, const SwapCode& sc);
00044 protected:
00045 static int GetIndex(SwapCode const & sc);
00046
00047 private:
00048 SwapCodeType SwapCodeValue;
00049 };
00050
00051 inline std::ostream& operator<<(std::ostream& os, const SwapCode& sc)
00052 {
00053 os << SwapCode::GetSwapCodeString(sc);
00054 return os;
00055 }
00056
00057 }
00058
00059 #endif //GDCMSWAPCODE_H