OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
VolumeDescriptorRecord.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 "VolumeDescriptorRecord.h"
13 
14 namespace ossimplugins
15 {
17 {
18 }
19 
21 {
22 }
23 
25 {
26  os<<"ascii_flag:"<<data._ascii_flag.c_str()<<std::endl;
27  os<<"format_doc:"<<data._format_doc.c_str()<<std::endl;
28  os<<"format_ver:"<<data._format_ver.c_str()<<std::endl;
29  os<<"format_rev:"<<data._format_rev.c_str()<<std::endl;
30  os<<"software_id:"<<data._software_id.c_str()<<std::endl;
31  os<<"phyvol_id:"<<data._phyvol_id.c_str()<<std::endl;
32  os<<"logvol_id:"<<data._logvol_id.c_str()<<std::endl;
33  os<<"volset_id:"<<data._volset_id.c_str()<<std::endl;
34  os<<"phyvol_cnt:"<<data._phyvol_cnt<<std::endl;
35  os<<"first_phyvol:"<<data._first_phyvol<<std::endl;
36  os<<"last_phyvol:"<<data._last_phyvol<<std::endl;
37  os<<"curr_phyvol:"<<data._curr_phyvol<<std::endl;
38  os<<"first_file:"<<data._first_file<<std::endl;
39  os<<"volset_log:"<<data._volset_log<<std::endl;
40  os<<"phyvol_log:"<<data._phyvol_log<<std::endl;
41  os<<"logvol_date:"<<data._logvol_date.c_str()<<std::endl;
42  os<<"logvol_time:"<<data._logvol_time.c_str()<<std::endl;
43  os<<"logvol_country:"<<data._logvol_country.c_str()<<std::endl;
44  os<<"logvol_agency:"<<data._logvol_agency.c_str()<<std::endl;
45  os<<"logvol_facility:"<<data._logvol_facility.c_str()<<std::endl;
46  os<<"n_filepoint:"<<data._n_filepoint<<std::endl;
47  os<<"n_voldir:"<<data._n_voldir<<std::endl;
48  os<<"product_id:"<<data._product_id.c_str()<<std::endl;
49 
50 
51  return os;
52 }
53 
55 {
56  char buf[349]; // 361-12
57  buf[348] = '\0';
58 
59  is.read(buf,2);
60  buf[2] = '\0';
61  data._ascii_flag = buf;
62 
63  is.read(buf,2); // spare1
64 
65  is.read(buf,12);
66  buf[12] = '\0';
67  data._format_doc = buf;
68 
69  is.read(buf,2);
70  buf[2] = '\0';
71  data._format_ver = buf;
72 
73  is.read(buf,2);
74  buf[2] = '\0';
75  data._format_rev = buf;
76 
77  is.read(buf,12);
78  buf[12] = '\0';
79  data._software_id = buf;
80 
81  is.read(buf,16);
82  buf[16] = '\0';
83  data._phyvol_id = buf;
84 
85  is.read(buf,16);
86  buf[16] = '\0';
87  data._logvol_id = buf;
88 
89  is.read(buf,16);
90  buf[16] = '\0';
91  data._volset_id = buf;
92 
93  is.read(buf,2);
94  buf[2] = '\0';
95  data._phyvol_cnt = atoi(buf);
96 
97  is.read(buf,2);
98  buf[2] = '\0';
99  data._first_phyvol = atoi(buf);
100 
101  is.read(buf,2);
102  buf[2] = '\0';
103  data._last_phyvol = atoi(buf);
104 
105  is.read(buf,2);
106  buf[2] = '\0';
107  data._curr_phyvol = atoi(buf);
108 
109  is.read(buf,4);
110  buf[4] = '\0';
111  data._first_file = atoi(buf);
112 
113  is.read(buf,4);
114  buf[4] = '\0';
115  data._volset_log = atoi(buf);
116 
117  is.read(buf,4);
118  buf[4] = '\0';
119  data._phyvol_log = atoi(buf);
120 
121  is.read(buf,8);
122  buf[8] = '\0';
123  data._logvol_date = buf;
124 
125  is.read(buf,8);
126  buf[8] = '\0';
127  data._logvol_time = buf;
128 
129  is.read(buf,12);
130  buf[12] = '\0';
131  data._logvol_country = buf;
132 
133 
134  is.read(buf,8);
135  buf[8] = '\0';
136  data._logvol_agency = buf;
137 
138  is.read(buf,12);
139  buf[12] = '\0';
140  data._logvol_facility = buf;
141 
142  is.read(buf,4);
143  buf[4] = '\0';
144  data._n_filepoint = atoi(buf);
145 
146  is.read(buf,4);
147  buf[4] = '\0';
148  data._n_voldir = atoi(buf);
149 
150  is.read(buf,92); // spare2
151 
152  is.read(buf,8);
153  buf[8] = '\0';
154  data._product_id = buf;
155 
156  is.read(buf,92); // spare3
157 
158  return is;
159 }
160 
162  RadarSatRecord(rhs),
163  _ascii_flag(rhs._ascii_flag),
164  _format_doc(rhs._format_doc),
165  _format_ver(rhs._format_ver),
166  _format_rev(rhs._format_rev),
167  _software_id(rhs._software_id),
168  _phyvol_id(rhs._phyvol_id),
169  _logvol_id(rhs._logvol_id),
170  _volset_id(rhs._volset_id),
171  _phyvol_cnt(rhs._phyvol_cnt),
172  _first_phyvol(rhs._first_phyvol),
173  _last_phyvol(rhs._last_phyvol),
174  _curr_phyvol(rhs._curr_phyvol),
175  _first_file(rhs._first_file),
176  _volset_log(rhs._volset_log),
177  _logvol_date(rhs._logvol_date),
178  _logvol_time(rhs._logvol_time),
179  _logvol_country(rhs._logvol_country),
180  _logvol_agency(rhs._logvol_agency),
181  _logvol_facility(rhs._logvol_facility),
182  _n_filepoint(rhs._n_filepoint),
183  _n_voldir(rhs._n_voldir),
184  _product_id(rhs._product_id)
185 {
186 }
187 
189 {
190  _ascii_flag = rhs._ascii_flag;
191  _format_doc = rhs._format_doc;
192  _format_ver = rhs._format_ver;
193  _format_rev = rhs._format_rev;
195  _phyvol_id = rhs._phyvol_id;
196  _logvol_id = rhs._logvol_id;
197  _volset_id = rhs._volset_id;
198  _phyvol_cnt = rhs._phyvol_cnt;
202  _first_file = rhs._first_file;
203  _volset_log = rhs._volset_log;
210  _n_voldir = rhs._n_voldir;
211  _product_id = rhs._product_id;
212  return *this;
213 }
214 }
VolumeDescriptorRecord & operator=(const VolumeDescriptorRecord &rhs)
Copy operator.
std::string _logvol_time
Logvol creation time.
std::string _format_doc
Format control documentation.
std::string _logvol_country
Logvol generation country.
int _n_voldir
Number of records in volume directory file.
int _curr_phyvol
Physical volume of current tape.
std::string _phyvol_id
Physical volume identifier.
int _first_file
First file number in physical volume.
std::string _logvol_facility
Logvol generation facility.
This class is the base class of all the record classes.
std::string _volset_id
Volume set identifier.
std::string _format_ver
Format doc version.
This class is able to read the SAR leader file descriptor record of the leader file.
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
std::string _product_id
Product identifier.
int _phyvol_cnt
Total physical volume count.
int _last_phyvol
Physical volume of last tape.
int _first_phyvol
Physical volume of first tape.
int _n_filepoint
Number of file pointer records.
int _volset_log
Logical volume within set.
std::string _software_id
Software identifier.
std::istream & operator>>(std::istream &is, AlosPalsarData &data)
std::string _format_rev
Format doc revision.
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
std::string _logvol_agency
Logvol generation agency.
int _phyvol_log
Logical volume within phyvol.
std::string _logvol_id
Logical volume identifier.
std::string _logvol_date
Logvol creation date.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23