Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GDCMBASICOFFSETTABLE_H
00017 #define GDCMBASICOFFSETTABLE_H
00018
00019 #include "gdcmFragment.h"
00020
00021 namespace gdcm
00022 {
00027 class GDCM_EXPORT BasicOffsetTable : public Fragment
00028 {
00029
00030
00031 public:
00032 BasicOffsetTable() : Fragment() {}
00033 friend std::ostream &operator<<(std::ostream &os, const BasicOffsetTable &val);
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 template <typename TSwap>
00045 std::istream &Read(std::istream &is) {
00046
00047 const Tag itemStart(0xfffe, 0xe000);
00048 const Tag seqDelItem(0xfffe,0xe0dd);
00049 if( !TagField.Read<TSwap>(is) )
00050 {
00051 assert(0 && "Should not happen");
00052 return is;
00053 }
00054
00055 if( TagField != itemStart )
00056 {
00057
00058 throw "SIEMENS Icon thingy";
00059 }
00060 if( !ValueLengthField.Read<TSwap>(is) )
00061 {
00062 assert(0 && "Should not happen");
00063 return is;
00064 }
00065
00066 SmartPointer<ByteValue> bv = new ByteValue;
00067 bv->SetLength(ValueLengthField);
00068 if( !bv->Read<TSwap>(is) )
00069 {
00070 assert(0 && "Should not happen");
00071 return is;
00072 }
00073 ValueField = bv;
00074 return is;
00075 }
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 };
00109
00110 inline std::ostream &operator<<(std::ostream &os, const BasicOffsetTable &val)
00111 {
00112 os << " BasicOffsetTable Length=" << val.ValueLengthField << std::endl;
00113 if( val.ValueField )
00114 {
00115 const ByteValue *bv = val.GetByteValue();
00116 assert( bv );
00117 os << *bv;
00118 }
00119
00120 return os;
00121 }
00122
00123
00124 }
00125
00126 #endif //GDCMBASICOFFSETTABLE_H