OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
FilePointerRecord.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 "FilePointerRecord.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<<"file_num:"<<data._file_num<<std::endl;
28  os<<"file_name:"<<data._file_name.c_str()<<std::endl;
29  os<<"file_class:"<<data._file_class.c_str()<<std::endl;
30  os<<"file_code:"<<data._file_code.c_str()<<std::endl;
31  os<<"data_type:"<<data._data_type.c_str()<<std::endl;
32  os<<"data_code:"<<data._data_code.c_str()<<std::endl;
33  os<<"nrec:"<<data._nrec<<std::endl;
34  os<<"first_len:"<<data._first_len<<std::endl;
35  os<<"max_len:"<<data._max_len<<std::endl;
36  os<<"len_type:"<<data._len_type.c_str()<<std::endl;
37  os<<"len_code:"<<data._len_code.c_str()<<std::endl;
38  os<<"first_phyvol:"<<data._first_phyvol<<std::endl;
39  os<<"last_phyvol:"<<data._last_phyvol<<std::endl;
40  os<<"first_rec:"<<data._first_rec<<std::endl;
41  os<<"last_rec:"<<data._last_rec<<std::endl;
42  return os;
43 }
44 
46 {
47  char buf[349]; // 361-12 (size of header)
48  buf[348] = '\0';
49 
50  is.read(buf, 2);
51  buf[2] = '\0';
52  data._ascii_flag = buf;
53 
54  is.read(buf, 2); // spare1
55 
56  is.read(buf, 4);
57  buf[4] = '\0';
58  data._file_num = atoi(buf);
59 
60  is.read(buf, 16);
61  buf[16] = '\0';
62  data._file_name = buf;
63 
64  is.read(buf, 28);
65  buf[28] = '\0';
66  data._file_class = buf;
67 
68  is.read(buf, 4);
69  buf[4] = '\0';
70  data._file_code = buf;
71 
72  is.read(buf, 28);
73  buf[28] = '\0';
74  data._data_type = buf;
75 
76  is.read(buf, 4);
77  buf[4] = '\0';
78  data._data_code = buf;
79 
80  is.read(buf, 8);
81  buf[8] = '\0';
82  data._nrec = atoi(buf);
83 
84  is.read(buf, 8);
85  buf[8] = '\0';
86  data._first_len = atoi(buf);
87 
88  is.read(buf, 8);
89  buf[8] = '\0';
90  data._max_len = atoi(buf);
91 
92  is.read(buf, 12);
93  buf[12] = '\0';
94  data._len_type = buf;
95 
96  is.read(buf, 4);
97  buf[4] = '\0';
98  data._len_code = buf;
99 
100  is.read(buf, 2);
101  buf[2] = '\0';
102  data._first_phyvol = atoi(buf);
103 
104  is.read(buf, 2);
105  buf[2] = '\0';
106  data._last_phyvol = atoi(buf);
107 
108  is.read(buf, 8);
109  buf[8] = '\0';
110  data._first_rec = atoi(buf);
111 
112  is.read(buf, 8);
113  buf[8] = '\0';
114  data._last_rec = atoi(buf);
115 
116  is.read(buf, 100); // spare2
117 
118  is.read(buf, 100); // spare3
119  return is;
120 }
121 
123  RadarSatRecord(rhs),
124  _ascii_flag(rhs._ascii_flag),
125  _file_num(rhs._file_num),
126  _file_name(rhs._file_name),
127  _file_class(rhs._file_class),
128  _file_code(rhs._file_code),
129  _data_type(rhs._data_type),
130  _data_code(rhs._data_code),
131  _nrec(rhs._nrec),
132  _first_len(rhs._first_len),
133  _max_len(rhs._max_len),
134  _len_type(rhs._len_type),
135  _len_code(rhs._len_code),
136  _first_phyvol(rhs._first_phyvol),
137  _last_phyvol(rhs._last_phyvol),
138  _first_rec(rhs._first_rec),
139  _last_rec(rhs._last_rec)
140 {
141 }
142 
144 {
145  _ascii_flag = rhs._ascii_flag;
146  _file_num = rhs._file_num;
147  _file_name = rhs._file_name;
148  _file_class = rhs._file_class;
149  _file_code = rhs._file_code;
150  _data_type = rhs._data_type;
151  _data_code = rhs._data_code;
152  _nrec = rhs._nrec;
153  _first_len = rhs._first_len;
154  _max_len = rhs._max_len;
155  _len_type = rhs._len_type;
156  _len_code = rhs._len_code;
159  _first_rec = rhs._first_rec;
160  _last_rec = rhs._last_rec;
161  return *this;
162 }
163 }
FilePointerRecord & operator=(const FilePointerRecord &rhs)
Copy operator.
std::string _len_type
Record length type.
virtual ~FilePointerRecord()
Destructor.
std::string _data_code
Referenced file data type code.
std::string _file_name
Referenced file name.
int _last_rec
Last physical volume record.
std::string _len_code
Record length type code.
int _file_num
Referenced file number.
This class is the base class of all the record classes.
std::string _ascii_flag
ASCII flag.
This class is able to read the SAR leader file descriptor record of the leader file.
std::string _file_class
Referenced file class.
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
int _first_rec
First physical volume record.
std::string _file_code
Referenced file class code.
std::istream & operator>>(std::istream &is, AlosPalsarData &data)
int _max_len
Maximum record length, bytes.
int _nrec
Referenced file record count.
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
int _first_len
First record length, bytes.
int _first_phyvol
First physical volume.
int _last_phyvol
Last physical volume.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
std::string _data_type
Referenced file data type.