Beispiel #1
0
        /// <summary>
        /// Constructs an instance of the <see cref="AsmEncoding"/> class, used to encode
        /// strings from UTF-8 source to architecture-specific encodings.
        /// </summary>
        /// <param name="caseSensitive">Indicates whether encoding names
        /// should be treated as case-sensitive. Note: This has no effect on how character
        /// mappings are translated</param>
        public AsmEncoding(bool caseSensitive)
        {
            _caseSensitive = caseSensitive;
            StringViewComparer comparer = caseSensitive ? StringViewComparer.Ordinal : StringViewComparer.IgnoreCase;

            _maps = new Dictionary <StringView, Dictionary <int, int> >(comparer);
            SelectEncoding("\"none\"");
        }
Beispiel #2
0
 /// <summary>
 /// Compares this instance with a specified <see cref="System.Object"/> and indicates
 /// whether this instance precedes, follows, or appears in the same position in the
 /// sort order as the specified <see cref="System.Object"/>.
 /// </summary>
 /// <param name="value">An object that evaluates to <see cref="StringView"/>.</param>
 /// <returns>A 32-bit signed integer that indicates whether this instance precedes,
 /// follows, or appears in the same position in the sort order as the value parameter.
 /// Value Condition Less than zero This instance precedes value. Zero This instance
 /// has the same position in the sort order as value. Greater than zero This instance
 /// follows value. -or- value is null.</returns>
 public int CompareTo(StringView value, StringViewComparer comparer)
 => comparer.Compare(this, value);
Beispiel #3
0
 /// <summary>
 /// Indicates whether this <see cref="StringView"/> object is equal in
 /// value to specified <see cref="StringView"/> object.
 /// </summary>
 /// <param name="other">The other <see cref="StringView"/> object.</param>
 /// <param name="comparer">A <see cref="StringViewComparer"/> to compare
 /// the two objects.</param>
 /// <returns><c>true</c> if both objects are equal in value;
 /// otherwise <c>false</c>.</returns>
 public bool Equals(StringView other, StringViewComparer comparer)
 => comparer.Equals(this, other);
Beispiel #4
0
 /// <summary>
 /// Instantiates a new <see cref="ReservedWords"/> class object.
 /// </summary>
 /// <param name="comparer">A <see cref="StringComparer"/> object to indicate whether
 /// to enforce case-sensitivity.</param>
 public ReservedWords(StringViewComparer comparer)
 => Comparer = comparer;