Exemplo n.º 1
0
        public static int NextOpening(BufferEntry entry, int position, string name)
        {
            int  index;
            byte value;

            int size = entry.PrimarySize;

            byte[] primary = entry.PrimaryData;

            while (position < size)
            {
                index = position + 1;
                value = primary[position];

                if (value == '\0')
                {
                    return(-1);
                }

                if (value == '<' && entry.IsEqual(ref index, name))
                {
                    value = entry.GetByteAt(index);

                    if (value == ' ' || value == '>' || value == '/' || value == '\r' || value == '\n' || value == '\t')
                    {
                        break;
                    }
                }

                position = index;
            }

            return(position);
        }