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

Method add_file_name

LASlib/src/lasreadermerged.cpp:47–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47BOOL LASreaderMerged::add_file_name(const CHAR* file_name)
48{
49 // do we have a file name
50 if (file_name == 0)
51 {
52 laserror("file name pointer is NULL");
53 return FALSE;
54 }
55 // does the file exist
56 FILE* file = LASfopen(file_name, "r");
57 if (file == 0)
58 {
59 laserror("file '%s' cannot be opened", file_name);
60 return FALSE;
61 }
62 fclose(file);
63 // check file extension
64 if (IsLasLazFile(std::string(file_name))) {
65 if (lasreaderbin)
66 {
67 laserror("cannot mix BIN with LAS. skipping '%s' ...", file_name);
68 return FALSE;
69 }
70 if (lasreadershp)
71 {
72 laserror("cannot mix SHP with LAS. skipping '%s' ...", file_name);
73 return FALSE;
74 }
75 if (lasreaderasc)
76 {
77 laserror("cannot mix ASC with LAS. skipping '%s' ...", file_name);
78 return FALSE;
79 }
80 if (lasreaderbil)
81 {
82 laserror("cannot mix BIL with LAS. skipping '%s' ...", file_name);
83 return FALSE;
84 }
85 if (lasreaderdtm)
86 {
87 laserror("cannot mix DTM with LAS. skipping '%s' ...", file_name);
88 return FALSE;
89 }
90 if (lasreaderply)
91 {
92 laserror("cannot mix PLY with LAS. skipping '%s' ...", file_name);
93 return FALSE;
94 }
95 if (lasreaderqfit)
96 {
97 laserror("cannot mix QFIT with LAS. skipping '%s' ...", file_name);
98 return FALSE;
99 }
100 if (lasreadertxt)
101 {
102 laserror("cannot mix TXT with LAS. skipping '%s' ...", file_name);
103 return FALSE;
104 }

Callers

nothing calls this directly

Calls 7

laserrorFunction · 0.85
LASfopenFunction · 0.85
IsLasLazFileFunction · 0.85
stringFunction · 0.85
HasFileExtFunction · 0.85
realloc_lasFunction · 0.85
malloc_lasFunction · 0.85

Tested by

no test coverage detected