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. */
| 76 | \return Name of the writer driver associated with the file. |
| 77 | */ |
| 78 | std::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 | |
| 99 | StageFactory::StageFactory(bool /* legacy */) |
nothing calls this directly
no test coverage detected