mirror of
https://github.com/github/codeql.git
synced 2026-03-17 13:06:48 +01:00
25 lines
803 B
C#
25 lines
803 B
C#
namespace Semmle.Autobuild
|
|
{
|
|
public sealed class Language
|
|
{
|
|
public static readonly Language Cpp = new Language(".vcxproj");
|
|
public static readonly Language CSharp = new Language(".csproj");
|
|
|
|
public bool ProjectFileHasThisLanguage(string path) =>
|
|
System.IO.Path.GetExtension(path) == ProjectExtension;
|
|
|
|
public static bool IsProjectFileForAnySupportedLanguage(string path) =>
|
|
Cpp.ProjectFileHasThisLanguage(path) || CSharp.ProjectFileHasThisLanguage(path);
|
|
|
|
public readonly string ProjectExtension;
|
|
|
|
private Language(string extension)
|
|
{
|
|
ProjectExtension = extension;
|
|
}
|
|
|
|
public override string ToString() =>
|
|
ProjectExtension == Cpp.ProjectExtension ? "C/C++" : "C#";
|
|
}
|
|
}
|