| 45 | } |
| 46 | |
| 47 | BOOL 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 | } |
nothing calls this directly
no test coverage detected