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

Method open

LASlib/src/lasreader_las.cpp:57–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55};
56
57BOOL LASreaderLAS::open(const char* file_name, I32 io_buffer_size, BOOL peek_only, U32 decompress_selective)
58{
59 if (file_name == 0)
60 {
61 laserror("file name pointer is zero");
62 return FALSE;
63 }
64 file = LASfopen(file_name, "rb");
65
66 if (file == 0)
67 {
68 laserror("cannot open file '%s' for read", file_name);
69 return FALSE;
70 }
71
72 // save file name for better ERROR message
73
74 if (this->file_name)
75 {
76 free(this->file_name);
77 this->file_name = 0;
78 }
79 this->file_name = LASCopyString(file_name);
80
81 if (setvbuf(file, NULL, _IOFBF, io_buffer_size) != 0)
82 {
83 LASMessage(LAS_WARNING, "setvbuf() failed with buffer size %d", io_buffer_size);
84 }
85
86 // create input
87 ByteStreamIn* in;
88 if (Endian::IS_LITTLE_ENDIAN)
89 in = new ByteStreamInFileLE(file);
90 else
91 in = new ByteStreamInFileBE(file);
92
93 return open(in, peek_only, decompress_selective);
94}
95
96BOOL LASreaderLAS::open(FILE* file, BOOL peek_only, U32 decompress_selective)
97{

Callers

nothing calls this directly

Calls 15

laserrorFunction · 0.85
LASfopenFunction · 0.85
LASMessageFunction · 0.85
compress_indicesFunction · 0.85
laserrormFunction · 0.85
get_ZMethod · 0.80
cleanMethod · 0.45
getBytesMethod · 0.45
get16bitsLEMethod · 0.45
get32bitsLEMethod · 0.45
get64bitsLEMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected