MCPcopy Create free account
hub / github.com/LASzip/LASzip / getFileExtension

Function getFileExtension

src/mydefs.cpp:484–494  ·  view source on GitHub ↗

Returns the extension of the file

Source from the content-addressed store, hash-verified

482
483/// Returns the extension of the file
484std::string getFileExtension(const char* filepath) {
485 if (!filepath) return "";
486
487 const char* dot = strrchr(filepath, '.');
488 if (!dot || *(dot + 1) == '\0') return ""; // No point or nothing after that
489
490 std::string ext(dot + 1);
491 // Optional: in lowercase letters
492 for (char& c : ext) c = std::tolower(static_cast<unsigned char>(c));
493 return ext;
494}
495
496// checks if given file is a las/laz file
497bool IsLasLazFile(std::string fn) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected