Port base APIs for D2D1 generator

このコミットが含まれているのは:
Sergio Pedri committed 2022-04-24 21:03:46 +02:00
1 親 2b0c7131ee
コミット 2212b8716d
39ファイル変更
+4354 -97

検索条件に一致するファイルはありません

+18
ファイルの表示
@@ -0,0 +1,18 @@
namespace ComputeSharp.D2D1Interop.SourceGenerators.Extensions;
/// <summary>
/// Extension methods for <see cref="string"/> types.
/// </summary>
internal static class StringExtensions
{
/// <summary>
/// Converts a given <see cref="string"/> instance to a valid HLSL identifier name.
/// </summary>
/// <param name="text">The input <see cref="string"/> instance to convert.</param>
/// <returns>An valid HLSL identifier name from <paramref name="text"/>.</returns>
public static string ToHlslIdentifierName(this string text)
{
return text.Replace('.', '_').Replace('+', '_');
}
}