Beispiel #1
0
 public static bool IsWhiteSpaceOrNewLine(char32 c)
 {
     return(c == ' ' ||  // space
            c == '\t' || // horizontal tab
            c == '\r' || // \r
            c == '\n');  // \n
 }
Beispiel #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));
 }
Beispiel #3
0
 public static bool IsDateTime(char32 c)
 {
     return(IsDigit(c) || c == ':' || c == '-' || c == 'Z' || c == 'T' || c == 'z' || c == 't' || c == '+' || c == '.');
 }
Beispiel #4
0
 public static bool IsDigit(char32 c)
 {
     return(c >= '0' && c <= '9');
 }
Beispiel #5
0
 public static bool IsValidUnicodeScalarValue(char32 c)
 {
     return(c >= 0 && c <= 0xD7FF || c >= 0xE000 && c < 0x10FFFF);
 }
Beispiel #6
0
 public static bool IsIdentifierContinue(char32 c)
 {
     return((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
 }
Beispiel #7
0
 public static bool IsKeyContinue(char32 c)
 {
     return((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || c == '-' || c >= '0' && c <= '9');
 }
Beispiel #8
0
 private static bool IsBinary(char32 c)
 {
     return(c == '0' || c == '1');
 }
Beispiel #9
0
 private static bool IsOctal(char32 c)
 {
     return(c >= '0' && c <= '7');
 }
Beispiel #10
0
 private static bool IsHex(char32 c)
 {
     return((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'));
 }
Beispiel #11
0
 public static int BinaryToDecimal(char32 c)
 {
     Debug.Assert(IsBinary(c));
     return(c - '0');
 }
Beispiel #12
0
 public static int OctalToDecimal(char32 c)
 {
     Debug.Assert(IsOctal(c));
     return(c - '0');
 }
Beispiel #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);
 }
Beispiel #14
0
 public static bool IsNewLine(char32 c)
 {
     return(c == '\r' || // \r
            c == '\n');  // \n
 }
Beispiel #15
0
 public static bool IsControlCharacter(char32 c)
 {
     return(c <= 0x1F || c == 0x7F);
 }
Beispiel #16
0
 public static bool IsWhiteSpace(char32 c)
 {
     return(c == ' ' || // space
            c == '\t'); // horizontal tab
 }