System.ByteMatcher.StartsWith C# (CSharp) Method

StartsWith() public method

public StartsWith ( int c ) : bool
c int
return bool
		public bool StartsWith (int c)
		{
			return (starts [c] != null);
		}

Usage Example

Esempio n. 1
0
        object GetKeyFromBuffer(bool cooked)
        {
            if (readpos >= writepos)
            {
                return(null);
            }

            int next = buffer [readpos];

            if (!cooked || !rootmap.StartsWith(next))
            {
                readpos++;
                AdjustBuffer();
                return(CreateKeyInfoFromInt(next));
            }

            int             used;
            TermInfoStrings str = rootmap.Match(buffer, readpos, writepos - readpos, out used);

            if ((int)str == -1)
            {
                return(null);
            }

            ConsoleKeyInfo key;

            if (keymap [str] != null)
            {
                key = (ConsoleKeyInfo)keymap [str];
            }
            else
            {
                readpos++;
                AdjustBuffer();
                return(CreateKeyInfoFromInt(next));
            }

            readpos += used;
            AdjustBuffer();
            return(key);
        }