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

Method inferWriterDriver

pdal/StageFactory.cpp:78–96  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

76 \return Name of the writer driver associated with the file.
77*/
78std::string StageFactory::inferWriterDriver(const std::string& filename)
79{
80 std::string lFilename = Utils::tolower(filename);
81 if (lFilename == "devnull" || lFilename == "/dev/null")
82 return "writers.null";
83 if (Utils::endsWith(filename, ".copc.laz"))
84 return "writers.copc";
85
86 std::string ext;
87 if (lFilename == "stdout")
88 ext = ".txt";
89 else
90 ext = Utils::tolower(FileUtils::extension(lFilename));
91 // Strip off '.' and make lowercase.
92 if (ext.length() > 1)
93 ext = Utils::tolower(ext.substr(1));
94
95 return PluginManager<Stage>::extensions().defaultWriter(ext);
96}
97
98
99StageFactory::StageFactory(bool /* legacy */)

Callers

nothing calls this directly

Calls 5

tolowerFunction · 0.85
endsWithFunction · 0.85
extensionFunction · 0.85
defaultWriterMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected