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

Function getFileExtension

LASzip/src/mydefs.cpp:480–490  ·  view source on GitHub ↗

Returns the extension of the file

Source from the content-addressed store, hash-verified

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

Callers 1

add_file_nameMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected