Exemplo n.º 1
0
 /// <summary>
 /// Constructs an escape transliterator with the given <paramref name="id"/> and
 /// parameters.  See the class member documentation for details.
 /// </summary>
 internal EscapeTransliterator(string id, string prefix, string suffix,
                               int radix, int minDigits,
                               bool grokSupplementals,
                               EscapeTransliterator supplementalHandler)
     : base(id, null)
 {
     this.prefix              = prefix;
     this.suffix              = suffix;
     this.radix               = radix;
     this.minDigits           = minDigits;
     this.grokSupplementals   = grokSupplementals;
     this.supplementalHandler = supplementalHandler;
 }
Exemplo n.º 2
0
 /// <seealso cref="Transliterator.AddSourceTargetSet(UnicodeSet, UnicodeSet, UnicodeSet)"/>
 public override void AddSourceTargetSet(UnicodeSet inputFilter, UnicodeSet sourceSet, UnicodeSet targetSet)
 {
     sourceSet.AddAll(GetFilterAsUnicodeSet(inputFilter));
     for (EscapeTransliterator it = this; it != null; it = it.supplementalHandler)
     {
         if (inputFilter.Count != 0)
         {
             targetSet.AddAll(it.prefix);
             targetSet.AddAll(it.suffix);
             StringBuilder buffer = new StringBuilder();
             for (int i = 0; i < it.radix; ++i)
             {
                 Utility.AppendNumber(buffer, i, it.radix, it.minDigits);
             }
             targetSet.AddAll(buffer.ToString()); // TODO drop once String is changed to CharSequence in UnicodeSet
         }
     }
 }