OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
dsd.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // "Copyright Centre National d'Etudes Spatiales"
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 //----------------------------------------------------------------------------
10 // $Id$
11 
12 #include <EnvisatAsar/dsd.h>
13 
14 namespace ossimplugins
15 {
16  dsd::dsd() : EnvisatAsarRecord("dsd_rec")
17  {
18  }
19 
21  {
22  }
23 
25  {
26  os<<"ds_name:"<<data._ds_name.c_str()<<std::endl;
27  os<<"ds_type:"<<data._ds_type.c_str()<<std::endl;
28  os<<"filename:"<<data._filename.c_str()<<std::endl;
29  os<<"ds_offset:"<<data._ds_offset<<std::endl;
30  os<<"ds_size:"<<data._ds_size<<std::endl;
31  os<<"num_dsr:"<<data._num_dsr<<std::endl;
32  os<<"dsr_size:"<<data._dsr_size<<std::endl;
33 
34  return os;
35  }
36 
38  {
39  char buf64[65];
40  buf64[64] = '\0';
41  // char buf32[33];
42  // buf32[32] = '\0';
43  char buf28[29];
44  buf28[28] = '\0';
45  char buf27[28];
46  buf27[27] = '\0';
47  // char buf20[21];
48  // buf20[20] = '\0';
49  char buf16[17];
50  buf16[16]='\0';
51  // char buf15[16];
52  // buf15[15] = '\0';
53  // char buf14[15];
54  // buf14[14] = '\0';
55  // char buf13[14];
56  // buf13[13] = '\0';
57  char buf12[13];
58  buf12[12] = '\0';
59  char buf11[12];
60  buf11[11] = '\0';
61  char buf10[11];
62  buf10[10] = '\0';
63  char buf9[10];
64  buf9[9] = '\0';
65  // char buf8[9];
66  // buf8[8] = '\0';
67  // char buf7[8];
68  // buf7[7] = '\0';
69  // char buf6[7];
70  // buf6[6] = '\0';
71  // char buf5[6];
72  // buf5[5] = '\0';
73  // char buf4[5];
74  // buf4[4] = '\0';
75  // char buf3[4];
76  // buf3[3] = '\0';
77  // char buf2[3];
78  // buf2[2] = '\0';
79  char buf1[1];
80 
81  is.read(buf9,9);
82 
83  is.read(buf28,28);
84  data._ds_name = buf28;
85 
86  is.read(buf10,10);
87 
88  is.read(buf1,1);
89  data._ds_type = buf1;
90 
91  is.read(buf11,11);
92 
93  is.read(buf64,62);
94  buf64[62] = '\0';
95  data._filename = buf64;
96 
97  is.read(buf12,12);
98 
99  is.read(buf27,21);
100  buf27[21] = '\0';
101  data._ds_offset = atof(buf27);
102 
103  is.read(buf16,16);
104 
105  is.read(buf27,21);
106  buf27[21] = '\0';
107  data._ds_size = atof(buf27);
108 
109  is.read(buf16,16);
110 
111  is.read(buf11,11);
112  data._num_dsr = atol(buf11);
113 
114  is.read(buf10,10);
115 
116  is.read(buf11,11);
117  data._dsr_size = atol(buf11);
118 
119  is.read(buf64,41);
120 
121  return is;
122 
123  }
124  std::string _ds_name;
125  std::string _ds_type;
126  std::string _filename;
127  double _ds_offset;
128  double _ds_size;
129  int _num_dsr;
131 
132  dsd::dsd(const dsd& rhs):
133  EnvisatAsarRecord(rhs),
134  _ds_name(rhs._ds_name),
135  _ds_type(rhs._ds_type),
136  _filename(rhs._filename),
137  _ds_offset(rhs._ds_offset),
138  _ds_size(rhs._ds_size),
139  _num_dsr(rhs._num_dsr),
140  _dsr_size(rhs._dsr_size)
141  {
142  }
143 
144 
145  dsd& dsd::operator=(const dsd& rhs)
146  {
147  _ds_name = rhs._ds_name;
148  _ds_type = rhs._ds_type;
149  _filename = rhs._filename;
150  _ds_offset = rhs._ds_offset;
151  _ds_size = rhs._ds_size;
152  _num_dsr = rhs._num_dsr;
153  _dsr_size = rhs._dsr_size;
154 
155  return *this;
156  }
157 }
int _num_dsr
Number of data set record.
Definition: dsd.h:163
dsd()
Constructor.
Definition: dsd.cpp:16
std::string _ds_type
Definition: dsd.cpp:125
std::string _filename
Data set Filename.
Definition: dsd.h:151
std::string _ds_name
Definition: dsd.cpp:124
int _dsr_size
Definition: dsd.cpp:130
double _ds_size
Data set Size.
Definition: dsd.h:159
double _ds_offset
Data set Offset.
Definition: dsd.h:155
std::string _ds_type
Data set Type.
Definition: dsd.h:147
int _dsr_size
Data set record size.
Definition: dsd.h:167
double _ds_size
Definition: dsd.cpp:128
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
virtual ~dsd()
Destructor.
Definition: dsd.cpp:20
double _ds_offset
Definition: dsd.cpp:127
int _num_dsr
Definition: dsd.cpp:129
std::istream & operator>>(std::istream &is, AlosPalsarData &data)
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
dsd & operator=(const dsd &rhs)
Copy operator.
Definition: dsd.cpp:145
This class is the base class of all the Envisat ASAR record classes.
std::string _ds_name
Data set Name.
Definition: dsd.h:143
std::string _filename
Definition: dsd.cpp:126
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
This class is able to read the ASAR dsd record.
Definition: dsd.h:24