Exemplo n.º 1
0
        // Token: 0x060011DE RID: 4574 RVA: 0x0007EC54 File Offset: 0x0007CE54
        public unsafe static int CalculateLowerCase(char[] buffer, int offset, int length)
        {
            int num  = 5381;
            int num2 = num;

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

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

            return(num + num2 * 1566083941);
        }
Exemplo n.º 2
0
            public void Write(char[] buffer, int offset, int count)
            {
                InternalDebug.Assert(!this.found && this.strIndex < this.str.Length);

                int end = offset + count;

                while (offset < end && this.strIndex < this.str.Length)
                {
                    if (ParseSupport.ToLowerCase(buffer[offset]) == this.str[this.strIndex])
                    {
                        this.strIndex++;
                    }
                    else
                    {
                        this.strIndex = 0;
                    }

                    offset++;
                }

                if (this.strIndex == this.str.Length)
                {
                    this.found = true;
                }
            }
Exemplo n.º 3
0
            public void Write(int ucs32Char)
            {
                if (Token.LiteralLength(ucs32Char) != 1)
                {
                    this.definitelyNotEqual = true;
                    return;
                }

                if (this.strIndex == 0)
                {
                    if (ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass((char)ucs32Char)))
                    {
                        return;
                    }
                }
                else if (this.strIndex == this.str.Length)
                {
                    if (ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass((char)ucs32Char)))
                    {
                        return;
                    }

                    this.definitelyNotEqual = true;
                    return;
                }

                if (this.str[this.strIndex] != ParseSupport.ToLowerCase((char)ucs32Char))
                {
                    this.definitelyNotEqual = true;
                    return;
                }

                this.strIndex++;
            }
Exemplo n.º 4
0
        public static int CalculateLowerCase(char[] buffer, int offset, int length)
        {
            int hash1 = 5381;
            int hash2 = hash1;

            HashCode.CheckArgs(buffer, offset, length);

            unsafe
            {
                fixed(char *src = buffer)
                {
                    char *s = src + offset;

                    while (length > 0)
                    {
                        hash1 = ((hash1 << 5) + hash1) ^ ParseSupport.ToLowerCase(s[0]);
                        if (length == 1)
                        {
                            break;
                        }
                        hash2   = ((hash2 << 5) + hash2) ^ ParseSupport.ToLowerCase(s[1]);
                        s      += 2;
                        length -= 2;
                    }
                }
            }

            return(hash1 + (hash2 * 1566083941));
        }
Exemplo n.º 5
0
        public static int CalculateLowerCase(string obj)
        {
            var hash1 = 5381;
            var hash2 = hash1;

            unsafe
            {
                fixed(char *src = obj)
                {
                    var s   = src;
                    var len = obj.Length;

                    while (len > 0)
                    {
                        hash1 = ((hash1 << 5) + hash1) ^ ParseSupport.ToLowerCase(s[0]);
                        if (len == 1)
                        {
                            break;
                        }
                        hash2 = ((hash2 << 5) + hash2) ^ ParseSupport.ToLowerCase(s[1]);
                        s    += 2;
                        len  -= 2;
                    }
                }
            }

            return(hash1 + (hash2 * 1566083941));
        }
Exemplo n.º 6
0
 // Token: 0x060011E6 RID: 4582 RVA: 0x0007F08C File Offset: 0x0007D28C
 public void AdvanceLowerCase(char c)
 {
     if ((this.offset++ & 1) == 0)
     {
         this.hash1 = ((this.hash1 << 5) + this.hash1 ^ (int)ParseSupport.ToLowerCase(c));
         return;
     }
     this.hash2 = ((this.hash2 << 5) + this.hash2 ^ (int)ParseSupport.ToLowerCase(c));
 }
Exemplo n.º 7
0
 public void AdvanceLowerCase(char c)
 {
     if (0 == (offset++ & 1))
     {
         hash1 = ((hash1 << 5) + hash1) ^ ParseSupport.ToLowerCase(c);
     }
     else
     {
         hash2 = ((hash2 << 5) + hash2) ^ ParseSupport.ToLowerCase(c);
     }
 }
Exemplo n.º 8
0
        public static int CompareLowerCaseStringToBufferStringIgnoreCase(string left, BufferString right)
        {
            int num = Math.Min(left.Length, right.Length);

            for (int i = 0; i < num; i++)
            {
                int num2 = (int)(left[i] - ParseSupport.ToLowerCase(right[i]));
                if (num2 != 0)
                {
                    return(num2);
                }
            }
            return(left.Length - right.Length);
        }
Exemplo n.º 9
0
 public bool StartsWithLowerCaseStringIgnoreCase(string rightPart)
 {
     if (this.count < rightPart.Length)
     {
         return(false);
     }
     for (int i = 0; i < rightPart.Length; i++)
     {
         if (ParseSupport.ToLowerCase(this.buffer[this.offset + i]) != rightPart[i])
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 10
0
        protected internal virtual bool CaseInsensitiveCompareRunEqual(int runOffset, string str, int strOffset)
        {
            int index = strOffset;

            while (index < str.Length)
            {
                InternalDebug.Assert(!ParseSupport.IsUpperCase(str[index]));

                if (ParseSupport.ToLowerCase(this.buffer[runOffset++]) != str[index++])
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 11
0
        public static int CompareLowerCaseStringToBufferStringIgnoreCase(string left, BufferString right)
        {
            var len = Math.Min(left.Length, right.Length);

            for (var i = 0; i < len; i++)
            {
                var cmp = (int)left[i] - (int)ParseSupport.ToLowerCase(right[i]);
                if (cmp != 0)
                {
                    return(cmp);
                }
            }



            return(left.Length - right.Length);
        }
Exemplo n.º 12
0
            public void Write(int ucs32Char)
            {
                InternalDebug.Assert(!this.found && this.strIndex < this.str.Length);

                if (Token.LiteralLength(ucs32Char) != 1 ||
                    this.str[this.strIndex] != ParseSupport.ToLowerCase((char)ucs32Char))
                {
                    this.strIndex = 0;
                    return;
                }

                this.strIndex++;

                if (this.strIndex == this.str.Length)
                {
                    this.found = true;
                }
            }
Exemplo n.º 13
0
        public bool StartsWithLowerCaseStringIgnoreCase(string rightPart)
        {
            AssertStringIsLowerCase(rightPart);



            if (count < rightPart.Length)
            {
                return(false);
            }

            for (var i = 0; i < rightPart.Length; i++)
            {
                if (ParseSupport.ToLowerCase(buffer[offset + i]) != rightPart[i])
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 14
0
 // Token: 0x060011E1 RID: 4577 RVA: 0x0007ED9C File Offset: 0x0007CF9C
 public unsafe void AdvanceLowerCase(char *s, int len)
 {
     if ((this.offset & 1) != 0)
     {
         this.hash2 = ((this.hash2 << 5) + this.hash2 ^ (int)ParseSupport.ToLowerCase(*s));
         s++;
         len--;
         this.offset++;
     }
     this.offset += len;
     while (len > 0)
     {
         this.hash1 = ((this.hash1 << 5) + this.hash1 ^ (int)ParseSupport.ToLowerCase(*s));
         if (len == 1)
         {
             return;
         }
         this.hash2 = ((this.hash2 << 5) + this.hash2 ^ (int)ParseSupport.ToLowerCase(s[1]));
         s         += 2;
         len       -= 2;
     }
 }
Exemplo n.º 15
0
        // Token: 0x060011DC RID: 4572 RVA: 0x0007EB50 File Offset: 0x0007CD50
        public unsafe static int CalculateLowerCase(BufferString obj)
        {
            int num  = 5381;
            int num2 = num;

            fixed(char *buffer = obj.Buffer)
            {
                char *ptr = buffer + obj.Offset;

                for (int i = obj.Length; i > 0; i -= 2)
                {
                    num = ((num << 5) + num ^ (int)ParseSupport.ToLowerCase(*ptr));
                    if (i == 1)
                    {
                        break;
                    }
                    num2 = ((num2 << 5) + num2 ^ (int)ParseSupport.ToLowerCase(ptr[1]));
                    ptr += 2;
                }
            }

            return(num + num2 * 1566083941);
        }
Exemplo n.º 16
0
            public void Write(char[] buffer, int offset, int count)
            {
                int end = offset + count;

                while (offset < end)
                {
                    if (this.strIndex == 0)
                    {
                        if (ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass(buffer[offset])))
                        {
                            offset++;
                            continue;
                        }
                    }
                    else if (this.strIndex == this.str.Length)
                    {
                        if (ParseSupport.WhitespaceCharacter(ParseSupport.GetCharClass(buffer[offset])))
                        {
                            offset++;
                            continue;
                        }

                        this.definitelyNotEqual = true;
                        break;
                    }

                    if (ParseSupport.ToLowerCase(buffer[offset]) != this.str[this.strIndex])
                    {
                        this.definitelyNotEqual = true;
                        break;
                    }

                    offset++;
                    this.strIndex++;
                }
            }
Exemplo n.º 17
0
        public unsafe void AdvanceLowerCase(char *s, int len)
        {
            if (0 != (this.offset & 1))
            {
                this.hash2 = ((this.hash2 << 5) + this.hash2) ^ ParseSupport.ToLowerCase(s[0]);
                s++;
                len--;
                this.offset++;
            }

            this.offset += len;

            while (len > 0)
            {
                this.hash1 = ((this.hash1 << 5) + this.hash1) ^ ParseSupport.ToLowerCase(s[0]);
                if (len == 1)
                {
                    break;
                }
                this.hash2 = ((this.hash2 << 5) + this.hash2) ^ ParseSupport.ToLowerCase(s[1]);
                s         += 2;
                len       -= 2;
            }
        }