| 1111 | } |
| 1112 | |
| 1113 | cm::string_view cmGlobalGenerator::GetLanguageFromExtension( |
| 1114 | cm::string_view ext) const |
| 1115 | { |
| 1116 | // if there is an extension and it starts with . then move past the |
| 1117 | // . because the extensions are not stored with a . in the map |
| 1118 | if (ext.empty()) { |
| 1119 | return ""; |
| 1120 | } |
| 1121 | if (ext.front() == '.') { |
| 1122 | ext = ext.substr(1); |
| 1123 | } |
| 1124 | #if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L |
| 1125 | auto const it = this->ExtensionToLanguage.find(ext); |
| 1126 | #else |
| 1127 | auto const it = this->ExtensionToLanguage.find(std::string(ext)); |
| 1128 | #endif |
| 1129 | if (it != this->ExtensionToLanguage.end()) { |
| 1130 | return it->second; |
| 1131 | } |
| 1132 | return ""; |
| 1133 | } |
| 1134 | |
| 1135 | /* SetLanguageEnabled() is now split in two parts: |
| 1136 | at first the enabled-flag is set. This can then be used in EnabledLanguage() |
no test coverage detected