Esempio n. 1
0
        public static LdapPath Parse(string path)
        {
            int      index  = 0;
            int      max    = path.Length;
            LdapPath result = new LdapPath();

            while (index < path.Length)
            {
                result._items.AddLast(LdapPathItem.Parse(path, ref index));
            }

            return(result);
        }
Esempio n. 2
0
        internal static LdapPathItem Parse(string path, ref int index)
        {
            LdapPathItem item = new LdapPathItem();
            StringBuilder str = new StringBuilder();

            int max = path.Length;

            SkipSpaces(path, ref index);

            while (index < max && path[index] != '=')
            {
                str.Append(path[index]);
                ++index;
            }

            if (index == max)
            {
                return LdapPathItem.Invalid;
            }

            item.Prefix = str.ToString().Trim();
            str.Length = 0;

            ++index; // skip equals

            SkipSpaces(path, ref index);

            while (index < max && path[index] != ',')
            {
                str.Append(path[index]);
                ++index;
            }

            item.Name = str.ToString().Trim();

            if (index < max)
            {
                ++index; // skip comma
            }

            SkipSpaces(path, ref index);

            return item;
        }
Esempio n. 3
0
        internal static LdapPathItem Parse(string path, ref int index)
        {
            LdapPathItem  item = new LdapPathItem();
            StringBuilder str  = new StringBuilder();

            int max = path.Length;

            SkipSpaces(path, ref index);

            while (index < max && path[index] != '=')
            {
                str.Append(path[index]);
                ++index;
            }

            if (index == max)
            {
                return(LdapPathItem.Invalid);
            }

            item.Prefix = str.ToString().Trim();
            str.Length  = 0;

            ++index; // skip equals

            SkipSpaces(path, ref index);

            while (index < max && path[index] != ',')
            {
                str.Append(path[index]);
                ++index;
            }

            item.Name = str.ToString().Trim();

            if (index < max)
            {
                ++index; // skip comma
            }

            SkipSpaces(path, ref index);

            return(item);
        }