예제 #1
0
        /// <summary>
        /// Instantiates the filter by cloning the allow list of another <see cref="ICodePointFilter"/>.
        /// </summary>
        public CodePointFilter(ICodePointFilter other)
        {
            CodePointFilter otherAsCodePointFilter = other as CodePointFilter;

            if (otherAsCodePointFilter != null)
            {
                _allowedCharsBitmap = otherAsCodePointFilter.GetAllowedCharsBitmap();
            }
            else
            {
                _allowedCharsBitmap = AllowedCharsBitmap.CreateNew();
                AllowFilter(other);
            }
        }
예제 #2
0
 /// <summary>
 /// Instantiates the filter where only the character ranges specified by <paramref name="allowedRanges"/>
 /// are allowed by the filter.
 /// </summary>
 public CodePointFilter(params UnicodeRange[] allowedRanges)
 {
     _allowedCharsBitmap = AllowedCharsBitmap.CreateNew();
     AllowRanges(allowedRanges);
 }
예제 #3
0
 /// <summary>
 /// Instantiates an empty filter (allows no code points through by default).
 /// </summary>
 public CodePointFilter()
 {
     _allowedCharsBitmap = AllowedCharsBitmap.CreateNew();
 }