Beispiel #1
0
 public void Write(int ucs32Char)
 {
     if (LiteralLength(ucs32Char) != 1)
     {
         definitelyNotEqual = true;
         return;
     }
     if (strIndex == 0)
     {
         if (ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass((char)ucs32Char)))
         {
             return;
         }
     }
     else if (strIndex == str.Length)
     {
         if (ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass((char)ucs32Char)))
         {
             return;
         }
         definitelyNotEqual = true;
         return;
     }
     if (str[strIndex] != ParseSupport.ToLowerCase((char)ucs32Char))
     {
         definitelyNotEqual = true;
         return;
     }
     strIndex++;
 }
Beispiel #2
0
            public void Write(char[] buffer, int offset, int count)
            {
                int num = offset + count;

                while (offset < num)
                {
                    if (strIndex == 0)
                    {
                        if (ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass(buffer[offset])))
                        {
                            offset++;
                            continue;
                        }
                    }
                    else if (strIndex == str.Length)
                    {
                        if (ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass(buffer[offset])))
                        {
                            offset++;
                            continue;
                        }
                        definitelyNotEqual = true;
                        return;
                    }
                    if (ParseSupport.ToLowerCase(buffer[offset]) != str[strIndex])
                    {
                        definitelyNotEqual = true;
                        return;
                    }
                    offset++;
                    strIndex++;
                }
            }
        public unsafe static int CalculateLowerCase(char[] buffer, int offset, int length)
        {
            int num  = 5381;
            int num2 = num;

            CheckArgs(buffer, offset, length);
            fixed(char *ptr = buffer)
            {
                char *ptr2 = ptr + offset;

                while (length > 0)
                {
                    num = ((num << 5) + num ^ ParseSupport.ToLowerCase(*ptr2));
                    if (length == 1)
                    {
                        break;
                    }
                    num2    = ((num2 << 5) + num2 ^ ParseSupport.ToLowerCase(ptr2[1]));
                    ptr2   += 2;
                    length -= 2;
                }
            }

            return(num + num2 * 1566083941);
        }
 public void AdvanceLowerCase(char c)
 {
     if ((offset++ & 1) == 0)
     {
         hash1 = ((hash1 << 5) + hash1 ^ ParseSupport.ToLowerCase(c));
         return;
     }
     hash2 = ((hash2 << 5) + hash2 ^ ParseSupport.ToLowerCase(c));
 }
Beispiel #5
0
        protected internal virtual bool CaseInsensitiveCompareRunEqual(int runOffset, string str, int strOffset)
        {
            int i = strOffset;

            while (i < str.Length)
            {
                if (ParseSupport.ToLowerCase(buffer[runOffset++]) != str[i++])
                {
                    return(false);
                }
            }
            return(true);
        }
Beispiel #6
0
 public void Write(int ucs32Char)
 {
     if (LiteralLength(ucs32Char) != 1 || str[strIndex] != ParseSupport.ToLowerCase((char)ucs32Char))
     {
         strIndex = 0;
         return;
     }
     strIndex++;
     if (strIndex == str.Length)
     {
         found = true;
     }
 }
Beispiel #7
0
 public bool EqualsToLowerCaseStringIgnoreCase(string rightPart)
 {
     if (count != rightPart.Length)
     {
         return(false);
     }
     for (int i = 0; i < rightPart.Length; i++)
     {
         if (ParseSupport.ToLowerCase(buffer[offset + i]) != rightPart[i])
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #8
0
            public void Write(char[] buffer, int offset, int count)
            {
                int num = offset + count;

                while (offset < num && strIndex < str.Length)
                {
                    if (ParseSupport.ToLowerCase(buffer[offset]) == str[strIndex])
                    {
                        strIndex++;
                    }
                    else
                    {
                        strIndex = 0;
                    }
                    offset++;
                }
                if (strIndex == str.Length)
                {
                    found = true;
                }
            }
 public unsafe void AdvanceLowerCase(char *s, int len)
 {
     if ((offset & 1) != 0)
     {
         hash2 = ((hash2 << 5) + hash2 ^ ParseSupport.ToLowerCase(*s));
         s++;
         len--;
         offset++;
     }
     offset += len;
     while (len > 0)
     {
         hash1 = ((hash1 << 5) + hash1 ^ ParseSupport.ToLowerCase(*s));
         if (len == 1)
         {
             return;
         }
         hash2 = ((hash2 << 5) + hash2 ^ ParseSupport.ToLowerCase(s[1]));
         s    += 2;
         len  -= 2;
     }
 }