| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.ComponentModel; |
| | 10 | |
|
| | 11 | | namespace Azure.Search.Documents.Indexes.Models |
| | 12 | | { |
| | 13 | | /// <summary> Defines flags that can be combined to control how regular expressions are used in the pattern analyzer |
| | 14 | | public readonly partial struct RegexFlag : IEquatable<RegexFlag> |
| | 15 | | { |
| | 16 | | private readonly string _value; |
| | 17 | |
|
| | 18 | | /// <summary> Determines if two <see cref="RegexFlag"/> values are the same. </summary> |
| | 19 | | /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> |
| | 20 | | public RegexFlag(string value) |
| | 21 | | { |
| 18 | 22 | | _value = value ?? throw new ArgumentNullException(nameof(value)); |
| 18 | 23 | | } |
| | 24 | |
|
| | 25 | | private const string CanonEqValue = "CANON_EQ"; |
| | 26 | | private const string CaseInsensitiveValue = "CASE_INSENSITIVE"; |
| | 27 | | private const string CommentsValue = "COMMENTS"; |
| | 28 | | private const string DotAllValue = "DOTALL"; |
| | 29 | | private const string LiteralValue = "LITERAL"; |
| | 30 | | private const string MultilineValue = "MULTILINE"; |
| | 31 | | private const string UnicodeCaseValue = "UNICODE_CASE"; |
| | 32 | | private const string UnixLinesValue = "UNIX_LINES"; |
| | 33 | |
|
| | 34 | | /// <summary> Enables canonical equivalence. </summary> |
| 0 | 35 | | public static RegexFlag CanonEq { get; } = new RegexFlag(CanonEqValue); |
| | 36 | | /// <summary> Enables case-insensitive matching. </summary> |
| 7 | 37 | | public static RegexFlag CaseInsensitive { get; } = new RegexFlag(CaseInsensitiveValue); |
| | 38 | | /// <summary> Permits whitespace and comments in the pattern. </summary> |
| 0 | 39 | | public static RegexFlag Comments { get; } = new RegexFlag(CommentsValue); |
| | 40 | | /// <summary> Enables dotall mode. </summary> |
| 0 | 41 | | public static RegexFlag DotAll { get; } = new RegexFlag(DotAllValue); |
| | 42 | | /// <summary> Enables literal parsing of the pattern. </summary> |
| 3 | 43 | | public static RegexFlag Literal { get; } = new RegexFlag(LiteralValue); |
| | 44 | | /// <summary> Enables multiline mode. </summary> |
| 3 | 45 | | public static RegexFlag Multiline { get; } = new RegexFlag(MultilineValue); |
| | 46 | | /// <summary> Enables Unicode-aware case folding. </summary> |
| 0 | 47 | | public static RegexFlag UnicodeCase { get; } = new RegexFlag(UnicodeCaseValue); |
| | 48 | | /// <summary> Enables Unix lines mode. </summary> |
| 0 | 49 | | public static RegexFlag UnixLines { get; } = new RegexFlag(UnixLinesValue); |
| | 50 | | /// <summary> Determines if two <see cref="RegexFlag"/> values are the same. </summary> |
| 0 | 51 | | public static bool operator ==(RegexFlag left, RegexFlag right) => left.Equals(right); |
| | 52 | | /// <summary> Determines if two <see cref="RegexFlag"/> values are not the same. </summary> |
| 0 | 53 | | public static bool operator !=(RegexFlag left, RegexFlag right) => !left.Equals(right); |
| | 54 | | /// <summary> Converts a string to a <see cref="RegexFlag"/>. </summary> |
| 0 | 55 | | public static implicit operator RegexFlag(string value) => new RegexFlag(value); |
| | 56 | |
|
| | 57 | | /// <inheritdoc /> |
| | 58 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 59 | | public override bool Equals(object obj) => obj is RegexFlag other && Equals(other); |
| | 60 | | /// <inheritdoc /> |
| 6 | 61 | | public bool Equals(RegexFlag other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgno |
| | 62 | |
|
| | 63 | | /// <inheritdoc /> |
| | 64 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 65 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 66 | | /// <inheritdoc /> |
| 20 | 67 | | public override string ToString() => _value; |
| | 68 | | } |
| | 69 | | } |