| 1233 | } |
| 1234 | |
| 1235 | std::string GetSourcecodeValueFromFileExtension( |
| 1236 | std::string const& _ext, std::string const& lang, |
| 1237 | bool& keepLastKnownFileType, std::vector<std::string> const& enabled_langs) |
| 1238 | { |
| 1239 | std::string ext = cmSystemTools::LowerCase(_ext); |
| 1240 | std::string sourcecode = "default"; |
| 1241 | |
| 1242 | if (ext == "o"_s) { |
| 1243 | keepLastKnownFileType = true; |
| 1244 | sourcecode = "compiled.mach-o.objfile"; |
| 1245 | } else if (ext == "xctest"_s) { |
| 1246 | sourcecode = "wrapper.cfbundle"; |
| 1247 | } else if (ext == "xib"_s) { |
| 1248 | keepLastKnownFileType = true; |
| 1249 | sourcecode = "file.xib"; |
| 1250 | } else if (ext == "storyboard"_s) { |
| 1251 | keepLastKnownFileType = true; |
| 1252 | sourcecode = "file.storyboard"; |
| 1253 | // NOLINTNEXTLINE(bugprone-branch-clone) |
| 1254 | } else if (ext == "mm"_s && !cm::contains(enabled_langs, "OBJCXX")) { |
| 1255 | sourcecode = "sourcecode.cpp.objcpp"; |
| 1256 | // NOLINTNEXTLINE(bugprone-branch-clone) |
| 1257 | } else if (ext == "m"_s && !cm::contains(enabled_langs, "OBJC")) { |
| 1258 | sourcecode = "sourcecode.c.objc"; |
| 1259 | } else if (ext == "swift"_s) { |
| 1260 | sourcecode = "sourcecode.swift"; |
| 1261 | } else if (ext == "plist"_s) { |
| 1262 | sourcecode = "sourcecode.text.plist"; |
| 1263 | } else if (ext == "h"_s) { |
| 1264 | sourcecode = "sourcecode.c.h"; |
| 1265 | } else if (ext == "hxx"_s || ext == "hpp"_s || ext == "txx"_s || |
| 1266 | ext == "pch"_s || ext == "hh"_s || ext == "inl"_s) { |
| 1267 | sourcecode = "sourcecode.cpp.h"; |
| 1268 | } else if (ext == "png"_s || ext == "gif"_s || ext == "jpg"_s) { |
| 1269 | keepLastKnownFileType = true; |
| 1270 | sourcecode = "image"; |
| 1271 | } else if (ext == "txt"_s) { |
| 1272 | sourcecode = "sourcecode.text"; |
| 1273 | } else if (lang == "CXX"_s) { |
| 1274 | sourcecode = "sourcecode.cpp.cpp"; |
| 1275 | } else if (lang == "C"_s) { |
| 1276 | sourcecode = "sourcecode.c.c"; |
| 1277 | } else if (lang == "OBJCXX"_s) { |
| 1278 | sourcecode = "sourcecode.cpp.objcpp"; |
| 1279 | } else if (lang == "OBJC"_s) { |
| 1280 | sourcecode = "sourcecode.c.objc"; |
| 1281 | } else if (lang == "Fortran"_s) { |
| 1282 | sourcecode = "sourcecode.fortran.f90"; |
| 1283 | } else if (lang == "ASM"_s) { |
| 1284 | sourcecode = "sourcecode.asm"; |
| 1285 | } else if (ext == "metal"_s) { |
| 1286 | sourcecode = "sourcecode.metal"; |
| 1287 | } else if (ext == "mig"_s) { |
| 1288 | sourcecode = "sourcecode.mig"; |
| 1289 | } else if (ext == "tbd"_s) { |
| 1290 | sourcecode = "sourcecode.text-based-dylib-definition"; |
| 1291 | } else if (ext == "a"_s) { |
| 1292 | keepLastKnownFileType = true; |
no outgoing calls
no test coverage detected
searching dependent graphs…