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

Method close

LASlib/src/laswriter_bin.cpp:252–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252I64 LASwriterBIN::close(BOOL update_npoints)
253{
254 I64 bytes = 0;
255
256 if (stream)
257 {
258 if (update_npoints && p_count != npoints)
259 {
260 if (!stream->isSeekable())
261 {
262 laserror("stream not seekable. cannot update header from %lld to %lld points.", npoints, p_count);
263 }
264 else
265 {
266 stream->seek(16);
267 stream->put32bitsLE((U8*)&p_count);
268 stream->seekEnd();
269 }
270 }
271 bytes = stream->tell();
272 delete stream;
273 stream = 0;
274 }
275
276 if (file)
277 {
278 fclose(file);
279 file = 0;
280 }
281
282 npoints = p_count;
283 p_count = 0;
284
285 return bytes;
286}
287
288LASwriterBIN::LASwriterBIN()
289{

Callers

nothing calls this directly

Calls 6

laserrorFunction · 0.85
isSeekableMethod · 0.45
seekMethod · 0.45
put32bitsLEMethod · 0.45
seekEndMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected