| 285 | //--------------------------------------------------------------------------- |
| 286 | |
| 287 | static LASunzipper* make_unzipper(IStream* ist, const LASzip* laszip) |
| 288 | { |
| 289 | LASunzipper* unzipper = new LASunzipper(); |
| 290 | if (unzipper == 0) |
| 291 | { |
| 292 | log("ERROR: could not alloc lasunzipper\n"); |
| 293 | exit(1); |
| 294 | } |
| 295 | bool success; |
| 296 | if (ist->m_use_iostream) |
| 297 | success = unzipper->open(*ist->streami, laszip); |
| 298 | else |
| 299 | success = unzipper->open(ist->ifile, laszip); |
| 300 | if (!success) |
| 301 | { |
| 302 | log("ERROR: could not open laszipper with %s because %s\n", ist->m_filename, unzipper->get_error()); |
| 303 | exit(1); |
| 304 | } |
| 305 | return unzipper; |
| 306 | } |
| 307 | |
| 308 | //--------------------------------------------------------------------------- |
| 309 | |