Exemple #1
0
 public static bool IsWhiteSpaceOrNewLine(char32 c)
 {
     return(c == ' ' ||  // space
            c == '\t' || // horizontal tab
            c == '\r' || // \r
            c == '\n');  // \n
 }
Exemple #2
0
 public static void AppendUtf32(this StringBuilder builder, char32 utf32)
 {
     if (utf32 < 65536)
     {
         builder.Append((char)utf32);
         return;
     }
     utf32 -= 65536;
     builder.Append((char)(utf32 / 1024 + 55296));
     builder.Append((char)(utf32 % 1024 + 56320));
 }
Exemple #3
0
 public static bool IsDateTime(char32 c)
 {
     return(IsDigit(c) || c == ':' || c == '-' || c == 'Z' || c == 'T' || c == 'z' || c == 't' || c == '+' || c == '.');
 }
Exemple #4
0
 public static bool IsDigit(char32 c)
 {
     return(c >= '0' && c <= '9');
 }
Exemple #5
0
 public static bool IsValidUnicodeScalarValue(char32 c)
 {
     return(c >= 0 && c <= 0xD7FF || c >= 0xE000 && c < 0x10FFFF);
 }
Exemple #6
0
 public static bool IsIdentifierContinue(char32 c)
 {
     return((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
 }
Exemple #7
0
 public static bool IsKeyContinue(char32 c)
 {
     return((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || c == '-' || c >= '0' && c <= '9');
 }
Exemple #8
0
 private static bool IsBinary(char32 c)
 {
     return(c == '0' || c == '1');
 }
Exemple #9
0
 private static bool IsOctal(char32 c)
 {
     return(c >= '0' && c <= '7');
 }
Exemple #10
0
 private static bool IsHex(char32 c)
 {
     return((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'));
 }
Exemple #11
0
 public static int BinaryToDecimal(char32 c)
 {
     Debug.Assert(IsBinary(c));
     return(c - '0');
 }
Exemple #12
0
 public static int OctalToDecimal(char32 c)
 {
     Debug.Assert(IsOctal(c));
     return(c - '0');
 }
Exemple #13
0
 public static int HexToDecimal(char32 c)
 {
     Debug.Assert(IsHex(c));
     return((c >= '0' && c <= '9') ? c - '0' : (c >= 'a' && c <= 'f') ? (c - 'a') + 10 : (c - 'A') + 10);
 }
Exemple #14
0
 public static bool IsNewLine(char32 c)
 {
     return(c == '\r' || // \r
            c == '\n');  // \n
 }
Exemple #15
0
 public static bool IsControlCharacter(char32 c)
 {
     return(c <= 0x1F || c == 0x7F);
 }
Exemple #16
0
 public static bool IsWhiteSpace(char32 c)
 {
     return(c == ' ' || // space
            c == '\t'); // horizontal tab
 }