コード例 #1
0
ファイル: UnicodeRanges.cs プロジェクト: noahfalk/corefx
 [MethodImpl(MethodImplOptions.NoInlining)] // the caller should be inlined, not this method
 private static UnicodeRange CreateRange(ref UnicodeRange range, char first, char last)
 {
     // If the range hasn't been created, create it now.
     // It's ok if two threads race and one overwrites the other's 'range' value.
     range = UnicodeRange.Create(first, last);
     return range;
 }
コード例 #2
0
ファイル: UnicodeRanges.cs プロジェクト: noahfalk/corefx
 [MethodImpl(MethodImplOptions.NoInlining)] // the caller should be inlined, not this method
 private static UnicodeRange CreateEmptyRange(ref UnicodeRange range)
 {
     // If the range hasn't been created, create it now.
     // It's ok if two threads race and one overwrites the other's 'range' value.
     range = new UnicodeRange(0, 0);
     return range;
 }
コード例 #3
0
ファイル: UnicodeRanges.cs プロジェクト: jsalvadorp/corefx
 [MethodImpl(MethodImplOptions.NoInlining)] // the caller should be inlined, not this method
 private static UnicodeRange CreateRange(ref UnicodeRange range, char first, char last)
 {
     // If the range hasn't been created, create it now.
     // It's ok if two threads race and one overwrites the other's 'range' value.
     Debug.Assert(last > first, "Code points were specified out of order.");
     var newRange = UnicodeRange.Create(first, last);
     Volatile.Write(ref range, newRange);
     return newRange;
 }
コード例 #4
0
ファイル: UnicodeRanges.cs プロジェクト: rplabon/corefx
        [MethodImpl(MethodImplOptions.NoInlining)] // the caller should be inlined, not this method
        private static UnicodeRange CreateEmptyRange(ref UnicodeRange range)
        {
            // If the range hasn't been created, create it now.
            // It's ok if two threads race and one overwrites the other's 'range' value.
            var newRange = new UnicodeRange(0, 0);

            Volatile.Write(ref range, newRange);
            return(newRange);
        }
コード例 #5
0
ファイル: UnicodeRanges.cs プロジェクト: rplabon/corefx
        [MethodImpl(MethodImplOptions.NoInlining)] // the caller should be inlined, not this method
        private static UnicodeRange CreateRange(ref UnicodeRange range, char first, char last)
        {
            // If the range hasn't been created, create it now.
            // It's ok if two threads race and one overwrites the other's 'range' value.
            Debug.Assert(last > first, "Code points were specified out of order.");
            var newRange = UnicodeRange.Create(first, last);

            Volatile.Write(ref range, newRange);
            return(newRange);
        }
コード例 #6
0
ファイル: TextEncoderSettings.cs プロジェクト: ESgarbi/corefx
        /// <summary>
        /// Allows all characters specified by <paramref name="range"/> through the filter.
        /// </summary>
        public virtual void AllowRange(UnicodeRange range)
        {
            if (range == null)
            {
                throw new ArgumentNullException(nameof(range));
            }

            int firstCodePoint = range.FirstCodePoint;
            int rangeSize = range.Length;
            for (int i = 0; i < rangeSize; i++)
            {
                _allowedCharactersBitmap.AllowCharacter((char)(firstCodePoint + i));
            }
        }
コード例 #7
0
 [MethodImpl(MethodImplOptions.NoInlining)] // the caller should be inlined, not this method
 private static UnicodeRange CreateRange([NotNull] ref UnicodeRange?range, char first, char last)
 {
     // It's ok if two threads race and one overwrites the other's 'range' value.
     Volatile.Write(ref range, UnicodeRange.Create(first, last));
     return(range);
 }
コード例 #8
0
ファイル: CodePointFilter.cs プロジェクト: jsalvadorp/corefx
        /// <summary>
        /// Disallows all characters specified by <paramref name="range"/> through the filter.
        /// </summary>
        /// <returns>
        /// The 'this' instance.
        /// </returns>
        public CodePointFilter ForbidRange(UnicodeRange range)
        {
            if (range == null)
            {
                throw new ArgumentNullException("range");
            }

            int firstCodePoint = range.FirstCodePoint;
            int rangeSize = range.Length;
            for (int i = 0; i < rangeSize; i++)
            {
                _allowedCharactersBitmap.ForbidCharacter((char)(firstCodePoint + i));
            }
            return this;
        }