MCPcopy Create free account
hub / github.com/LAStools/LAStools / reopen

Method reopen

LASlib/src/lasreaderstored.cpp:128–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128BOOL LASreaderStored::reopen()
129{
130 if (streaminarray)
131 {
132 streaminarray->seek(0);
133 }
134 else
135 {
136 if (streamoutarray == 0)
137 {
138 laserror("no streamoutarray");
139 return FALSE;
140 }
141
142 if (streamoutarray->getSize() == 0)
143 {
144 laserror("nothing stored in streamoutarray");
145 return FALSE;
146 }
147
148 if (Endian::IS_LITTLE_ENDIAN)
149 streaminarray = new ByteStreamInArrayLE(streamoutarray->takeData(), streamoutarray->getSize());
150 else
151 streaminarray = new ByteStreamInArrayBE(streamoutarray->takeData(), streamoutarray->getSize());
152
153 if (streaminarray == 0)
154 {
155 laserror("creating streaminarray");
156 return FALSE;
157 }
158 }
159
160 // create the LASreader
161
162 if (lasreader) delete lasreader;
163 lasreader = 0;
164
165 LASreaderLAS* lasreaderlas = new LASreaderLAS(opener);
166
167 if (lasreaderlas == 0)
168 {
169 laserror("allocating lasreaderlas");
170 return FALSE;
171 }
172
173 if (!lasreaderlas->open(streaminarray))
174 {
175 delete lasreaderlas;
176 lasreaderlas = 0;
177 laserror("opening lasreaderlas from streaminarray");
178 return FALSE;
179 }
180
181 lasreaderlas->set_delete_stream(FALSE);
182
183 lasreader = lasreaderlas;
184
185 header = lasreader->header;

Callers

nothing calls this directly

Calls 5

laserrorFunction · 0.85
getSizeMethod · 0.80
takeDataMethod · 0.80
seekMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected