mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
24 lines
746 B
C#
24 lines
746 B
C#
namespace Semmle.Autobuild.Shared
|
|
{
|
|
public sealed class Language
|
|
{
|
|
public static readonly Language Cpp = new Language(".vcxproj", "CPP");
|
|
public static readonly Language CSharp = new Language(".csproj", "CSHARP");
|
|
|
|
public bool ProjectFileHasThisLanguage(string path) =>
|
|
System.IO.Path.GetExtension(path) == ProjectExtension;
|
|
|
|
public readonly string ProjectExtension;
|
|
public readonly string UpperCaseName;
|
|
|
|
private Language(string extension, string name)
|
|
{
|
|
ProjectExtension = extension;
|
|
UpperCaseName = name;
|
|
}
|
|
|
|
public override string ToString() =>
|
|
ProjectExtension == Cpp.ProjectExtension ? "C/C++" : "C#";
|
|
}
|
|
}
|