| #include <dds/util/string.hpp> | #include <dds/util/string.hpp> | ||||
| #include <algorithm> | #include <algorithm> | ||||
| #include <cassert> | |||||
| #include <optional> | #include <optional> | ||||
| #include <vector> | #include <vector> | ||||
| std::optional<source_kind> dds::infer_source_kind(path_ref p) noexcept { | std::optional<source_kind> dds::infer_source_kind(path_ref p) noexcept { | ||||
| static std::vector<std::string_view> header_exts = { | static std::vector<std::string_view> header_exts = { | ||||
| ".h", | |||||
| ".H", | ".H", | ||||
| ".H++", | ".H++", | ||||
| ".h", | |||||
| ".h++", | ".h++", | ||||
| ".hh", | ".hh", | ||||
| ".hpp", | ".hpp", | ||||
| ".hxx", | ".hxx", | ||||
| ".inl", | ".inl", | ||||
| }; | }; | ||||
| assert(std::is_sorted(header_exts.begin(), header_exts.end())); | |||||
| static std::vector<std::string_view> source_exts = { | static std::vector<std::string_view> source_exts = { | ||||
| ".C", | ".C", | ||||
| ".c", | ".c", | ||||
| ".cpp", | ".cpp", | ||||
| ".cxx", | ".cxx", | ||||
| }; | }; | ||||
| assert(std::is_sorted(source_exts.begin(), source_exts.end())); | |||||
| auto leaf = p.filename(); | auto leaf = p.filename(); | ||||
| auto ext_found | auto ext_found |