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. */
| 50 | \return Name of the reader driver associated with the file. |
| 51 | */ |
| 52 | std::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 | /** |
no test coverage detected