-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9173af7
commit 472587b
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// <auto-generated /> | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
#pragma warning disable | ||
|
||
#if !NET7_0_OR_GREATER | ||
|
||
namespace System.Text.RegularExpressions; | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Link = System.ComponentModel.DescriptionAttribute; | ||
|
||
/// <summary> | ||
/// Instructs the System.Text.RegularExpressions source generator to generate an implementation of the specified regular expression. | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
[DebuggerNonUserCode] | ||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] | ||
[Link("https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.generatedregexattribute")] | ||
#if PolyPublic | ||
public | ||
#endif | ||
public sealed class GeneratedRegexAttribute : Attribute | ||
{ | ||
/// <summary>Initializes a new instance of the <see cref="GeneratedRegexAttribute"/> with the specified pattern.</summary> | ||
/// <param name="pattern">The regular expression pattern to match.</param> | ||
public GeneratedRegexAttribute([StringSyntax(StringSyntaxAttribute.Regex)] string pattern) | ||
: this(pattern, RegexOptions.None) | ||
{ | ||
} | ||
|
||
/// <summary>Initializes a new instance of the <see cref="GeneratedRegexAttribute"/> with the specified pattern and options.</summary> | ||
/// <param name="pattern">The regular expression pattern to match.</param> | ||
/// <param name="options">A bitwise combination of the enumeration values that modify the regular expression.</param> | ||
public GeneratedRegexAttribute([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) | ||
: this(pattern, options, -1) | ||
{ | ||
} | ||
|
||
/// <summary>Initializes a new instance of the <see cref="GeneratedRegexAttribute"/> with the specified pattern and options.</summary> | ||
/// <param name="pattern">The regular expression pattern to match.</param> | ||
/// <param name="options">A bitwise combination of the enumeration values that modify the regular expression.</param> | ||
/// <param name="cultureName">The name of a culture to be used for case sensitive comparisons. <paramref name="cultureName"/> is not case-sensitive.</param> | ||
/// <remarks> | ||
/// For a list of predefined culture names on Windows systems, see the Language tag column in the <see href="https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c">list of | ||
/// language/region names suported by Windows</see>. Culture names follow the standard defined by <see href="https://tools.ietf.org/html/bcp47">BCP 47</see>. In addition, | ||
/// starting with Windows 10, <paramref name="cultureName"/> can be any valid BCP-47 language tag. | ||
/// | ||
/// If <paramref name="cultureName"/> is <see cref="string.Empty"/>, the invariant culture will be used. | ||
/// </remarks> | ||
public GeneratedRegexAttribute([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, string cultureName) | ||
: this(pattern, options, -1, cultureName) | ||
{ | ||
} | ||
|
||
/// <summary>Initializes a new instance of the <see cref="GeneratedRegexAttribute"/> with the specified pattern, options, and timeout.</summary> | ||
/// <param name="pattern">The regular expression pattern to match.</param> | ||
/// <param name="options">A bitwise combination of the enumeration values that modify the regular expression.</param> | ||
/// <param name="matchTimeoutMilliseconds">A time-out interval (milliseconds), or <see cref="Timeout.Infinite"/> to indicate that the method should not time out.</param> | ||
public GeneratedRegexAttribute([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, int matchTimeoutMilliseconds) | ||
: this(pattern, options, matchTimeoutMilliseconds, string.Empty /* Empty string means Invariant culture */) | ||
{ | ||
} | ||
|
||
/// <summary>Initializes a new instance of the <see cref="GeneratedRegexAttribute"/> with the specified pattern, options, and timeout.</summary> | ||
/// <param name="pattern">The regular expression pattern to match.</param> | ||
/// <param name="options">A bitwise combination of the enumeration values that modify the regular expression.</param> | ||
/// <param name="matchTimeoutMilliseconds">A time-out interval (milliseconds), or <see cref="Timeout.Infinite"/> to indicate that the method should not time out.</param> | ||
/// <param name="cultureName">The name of a culture to be used for case sensitive comparisons. <paramref name="cultureName"/> is not case-sensitive.</param> | ||
/// <remarks> | ||
/// For a list of predefined culture names on Windows systems, see the Language tag column in the <see href="https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c">list of | ||
/// language/region names suported by Windows</see>. Culture names follow the standard defined by <see href="https://tools.ietf.org/html/bcp47">BCP 47</see>. In addition, | ||
/// starting with Windows 10, <paramref name="cultureName"/> can be any valid BCP-47 language tag. | ||
/// | ||
/// If <paramref name="cultureName"/> is <see cref="string.Empty"/>, the invariant culture will be used. | ||
/// </remarks> | ||
public GeneratedRegexAttribute([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, int matchTimeoutMilliseconds, string cultureName) | ||
{ | ||
Pattern = pattern; | ||
Options = options; | ||
MatchTimeoutMilliseconds = matchTimeoutMilliseconds; | ||
CultureName = cultureName; | ||
} | ||
|
||
/// <summary>Gets the regular expression pattern to match.</summary> | ||
public string Pattern { get; } | ||
|
||
/// <summary>Gets a bitwise combination of the enumeration values that modify the regular expression.</summary> | ||
public RegexOptions Options { get; } | ||
|
||
/// <summary>Gets a time-out interval (milliseconds), or <see cref="Timeout.Infinite"/> to indicate that the method should not time out.</summary> | ||
public int MatchTimeoutMilliseconds { get; } | ||
|
||
/// <summary>Gets the name of the culture to be used for case sensitive comparisons.</summary> | ||
public string CultureName { get; } | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters