MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / fromMimeType

Method fromMimeType

context/ProgrammingLanguage.cpp:9–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace QodeAssist::Context {
8
9ProgrammingLanguage ProgrammingLanguageUtils::fromMimeType(const QString &mimeType)
10{
11 if (mimeType == "text/x-qml" || mimeType == "application/javascript"
12 || mimeType == "text/javascript" || mimeType == "text/x-javascript") {
13 return ProgrammingLanguage::QML;
14 }
15 if (mimeType == "text/x-c++src" || mimeType == "text/x-c++hdr" || mimeType == "text/x-csrc"
16 || mimeType == "text/x-chdr") {
17 return ProgrammingLanguage::Cpp;
18 }
19 if (mimeType == "text/x-python") {
20 return ProgrammingLanguage::Python;
21 }
22 return ProgrammingLanguage::Unknown;
23}
24
25QString ProgrammingLanguageUtils::toString(ProgrammingLanguage language)
26{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected