Example #1
0
 internal static int GetBidiClass(int ch) {
   ByteData table = null;
   lock (ValueBidiClassesSync) {
     bidiClasses = bidiClasses ?? ByteData.Decompress(IdnaData.BidiClasses);
     table = bidiClasses;
   }
   return table.GetByte(ch);
 }
Example #2
0
 public static int GetCombiningClass(int cp)
 {
     if (cp < 0x300 || cp >= 0xe0000) {
      return 0;
     }
       if (classes == null) {
     lock (syncRoot) {
     classes = classes ?? ByteData.Decompress(NormalizationData.CombiningClasses);
     }
     }
       return ((int)classes.GetByte(cp)) & 0xff;
 }
Example #3
0
 public static bool IsQuickCheckStarter(int cp, Normalization form)
 {
     // Code points for which QuickCheck = YES and with a combining
       // class of 0
       ByteData bd = null;
       if (form == Normalization.NFC &&
       (cp < NormalizationData.QCSNFCMin || cp >
       NormalizationData.QCSNFCMax)) {
     return true;
       }
       if (form == Normalization.NFD &&
       (cp < NormalizationData.QCSNFDMin || cp >
       NormalizationData.QCSNFDMax)) {
     return true;
       }
       if (form == Normalization.NFKC &&
     (cp < NormalizationData.QCSNFKCMin || cp >
       NormalizationData.QCSNFKCMax)) {
     return true;
       }
       if (form == Normalization.NFKD &&
     (cp < NormalizationData.QCSNFKDMin || cp >
       NormalizationData.QCSNFKDMax)) {
     return true;
       }
     if (form == Normalization.NFC) {
       if (qcsnfc == null) {
     lock (syncRoot) {
     qcsnfc = qcsnfc ?? ByteData.Decompress(NormalizationData.QCSNFC);
     }
     }
     bd = qcsnfc;
     }
     if (form == Normalization.NFD) {
       if (qcsnfd == null) {
     lock (syncRoot) {
     qcsnfd = qcsnfd ?? ByteData.Decompress(NormalizationData.QCSNFD);
     }
     }
     bd = qcsnfd;
     }
     if (form == Normalization.NFKC) {
       if (qcsnfkc == null) {
     lock (syncRoot) {
     qcsnfkc = qcsnfkc ?? ByteData.Decompress(NormalizationData.QCSNFKC);
     }
     }
     bd = qcsnfkc;
     }
     if (form == Normalization.NFKD) {
       if (qcsnfkd == null) {
     lock (syncRoot) {
     qcsnfkd = qcsnfkd ?? ByteData.Decompress(NormalizationData.QCSNFKD);
     }
     }
     bd = qcsnfkd;
     }
       return bd != null && bd.GetBoolean(cp);
 }
Example #4
0
 public static bool IsCombiningMark(int cp)
 {
     if (combmark == null) {
     lock (syncRoot) {
     combmark = combmark ?? ByteData.Decompress(IdnaData.CombiningMarks);
     }
     }
     return combmark.GetBoolean(cp);
 }
Example #5
0
 public static int GetIdnaCategory(int cp)
 {
     if (idnaCat == null) {
     lock (syncRoot) {
     idnaCat = idnaCat ?? ByteData.Decompress(IdnaData.IdnaCategories);
     }
     }
       return ((int)idnaCat.GetByte(cp)) & 0xff;
 }
Example #6
0
 private static int GetScript(int ch)
 {
     ByteData table = null;
     if (scripts == null) {
     lock (syncRoot) {
     scripts = scripts ?? ByteData.Decompress(IdnaData.IdnaRelevantScripts);
     }
     }
     table = scripts;
       return table.GetByte(ch);
 }
Example #7
0
 private static int GetJoiningType(int ch)
 {
     ByteData table = null;
      if (joiningTypes == null) {
     lock (syncRoot) {
     joiningTypes = joiningTypes ?? ByteData.Decompress(IdnaData.JoiningTypes);
     }
     }
     table = joiningTypes;
       return table.GetByte(ch);
 }
Example #8
0
 internal static int GetBidiClass(int ch)
 {
     ByteData table = null;
     if (bidiClasses == null) {
     lock (syncRoot) {
     bidiClasses = bidiClasses ?? ByteData.Decompress(IdnaData.BidiClasses);
     }
     }
     table = bidiClasses;
       return table.GetByte(ch);
 }
Example #9
0
   public static int GetCombiningClass(int cp) {
     lock (ValueClassesSyncRoot) {
 classes = classes ?? ByteData.Decompress(NormalizationData.CombiningClasses);
     }
     return ((int)classes.GetByte(cp)) & 0xff;
   }
Example #10
0
 public static bool IsCombiningMark(int cp) {
   lock (ValueCmSyncRoot) {
     combmark = combmark ?? ByteData.Decompress(IdnaData.CombiningMarks);
     return combmark.GetBoolean(cp);
   }
 }
Example #11
0
 private static int GetScript(int ch) {
   ByteData table = null;
   lock (ValueScriptsSync) {
     scripts = scripts ?? ByteData.Decompress(IdnaData.IdnaRelevantScripts);
     table = scripts;
   }
   return table.GetByte(ch);
 }
Example #12
0
 private static int GetJoiningType(int ch) {
   ByteData table = null;
   lock (ValueJoiningTypesSync) {
  joiningTypes = joiningTypes ?? ByteData.Decompress(IdnaData.JoiningTypes);
     table = joiningTypes;
   }
   return table.GetByte(ch);
 }