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

Function fopen_compressed

LASlib/src/fopen_compressed.cpp:333–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331extern "C"
332{
333FILE* fopen_compressed(const char* filename, const char* mode, bool* piped)
334{
335 int len;
336 FILE* file;
337 len = (int)strlen(filename);
338
339 if (strcmp(filename+len-3, ".gz") == 0)
340 {
341#ifdef _WIN32
342 file = fopenGzipped(filename, mode);
343 if (piped) *piped = true;
344#else
345 laserror("no support for gzipped input");
346 return 0;
347#endif
348 }
349 else if (strcmp(filename+len-4, ".zip") == 0)
350 {
351#ifdef _WIN32
352 file = fopenZIPped(filename, mode);
353 if (piped) *piped = true;
354#else
355 laserror("no support for ZIPped input");
356 return 0;
357#endif
358 }
359 else if (strcmp(filename+len-3, ".7z") == 0)
360 {
361#ifdef _WIN32
362 file = fopen7zipped(filename, mode);
363 if (piped) *piped = true;
364#else
365 laserror("no support for 7zipped input");
366 return 0;
367#endif
368 }
369 else if (strcmp(filename+len-4, ".rar") == 0)
370 {
371#ifdef _WIN32
372 file = fopenRARed(filename, mode);
373 if (piped) *piped = true;
374#else
375 laserror("no support for RARed input");
376 return 0;
377#endif
378 }
379 else
380 {
381 file = LASfopen(filename, mode);
382 if (piped) *piped = false;
383 }
384 return file;
385}
386}

Callers 8

openMethod · 0.85
reopenMethod · 0.85
openMethod · 0.85
reopenMethod · 0.85
openMethod · 0.85
reopenMethod · 0.85
openMethod · 0.85
reopenMethod · 0.85

Calls 6

fopenGzippedFunction · 0.85
laserrorFunction · 0.85
fopenZIPpedFunction · 0.85
fopen7zippedFunction · 0.85
fopenRARedFunction · 0.85
LASfopenFunction · 0.85

Tested by

no test coverage detected