MCPcopy Create free account
hub / github.com/LASzip/LASzip / open

Method open

src/lasunzipper.cpp:40–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38#include "lasreadpoint.hpp"
39
40bool LASunzipper::open(FILE* infile, const LASzip* laszip)
41{
42 if (!infile) return return_error("FILE* infile pointer is NULL");
43 if (!laszip) return return_error("const LASzip* laszip pointer is NULL");
44 count = 0;
45 if (reader) delete reader;
46 reader = new LASreadPoint();
47 if (!reader) return return_error("alloc of LASreadPoint failed");
48 if (!reader->setup(laszip->num_items, laszip->items, laszip)) return return_error("setup() of LASreadPoint failed");
49 if (stream) delete stream;
50 if (IS_LITTLE_ENDIAN())
51 stream = new ByteStreamInFileLE(infile);
52 else
53 stream = new ByteStreamInFileBE(infile);
54 if (!stream) return return_error("alloc of ByteStreamInFile failed");
55 if (!reader->init(stream)) return return_error("init() of LASreadPoint failed");
56 return true;
57}
58
59bool LASunzipper::open(istream& instream, const LASzip* laszip)
60{

Callers

nothing calls this directly

Calls 2

setupMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected