MCPcopy Create free account
hub / github.com/PDAL/PDAL / inferReaderDriver

Method inferReaderDriver

pdal/StageFactory.cpp:52–69  ·  view source on GitHub ↗

Find the default reader for a file. \param filename Filename for which to infer a reader. \return Name of the reader driver associated with the file. */

Source from the content-addressed store, hash-verified

50 \return Name of the reader driver associated with the file.
51*/
52std::string StageFactory::inferReaderDriver(const std::string& filename)
53{
54 std::string ext;
55
56 if (Utils::endsWith(filename, "ept.json") || Utils::startsWith(filename, "ept://"))
57 return "readers.ept";
58 if (Utils::startsWith(filename, "i3s://"))
59 return "readers.i3s";
60 if (Utils::endsWith(filename, ".copc.laz"))
61 return "readers.copc";
62
63 ext = FileUtils::extension(filename);
64 // Strip off '.' and make lowercase.
65 if (ext.length() > 1)
66 ext = Utils::tolower(ext.substr(1));
67
68 return PluginManager<Stage>::extensions().defaultReader(ext);
69}
70
71
72/**

Callers 3

initializeMethod · 0.80
extractDriverFromItemMethod · 0.80
checkXYZFunction · 0.80

Calls 6

endsWithFunction · 0.85
startsWithFunction · 0.85
extensionFunction · 0.85
tolowerFunction · 0.85
defaultReaderMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected