Esempio n. 1
0
        private lineinfo parsestring(string line)
        {
            lineinfo i = new lineinfo();

            if (line.IndexOf("</") == -1)
            {
                i.type = line.Substring(line.IndexOf('<') + 1, line.IndexOf(' ') - line.IndexOf('<') - 1);
                if (i.type == "var f")
                {
                    i.type = "var";//best hack
                }
                int fpos = line.IndexOf('\"');
                int spos = line.IndexOf('\"', fpos + 1);
                i._ref = line.Substring(fpos + 1, spos - fpos - 1);
                i.line = i._ref.Substring(i._ref.IndexOf(':') + 1);
                i._ref = i._ref.Substring(0, i._ref.IndexOf(':'));
                i.name = line.Substring(line.IndexOf('>') + 1, line.IndexOf('\r') - line.IndexOf('>') - 1);
            }
            else if (line.IndexOf("</val>") != -1)
            {
                i.type = "val";
                int fpos = line.IndexOf('\"');
                int spos = line.IndexOf('\"', fpos + 1);
                i._ref = line.Substring(fpos + 1, spos - fpos);
                i.line = i._ref.Substring(i._ref.IndexOf(':') + 1, 1);
                i._ref = i._ref.Substring(0, i._ref.IndexOf(':'));
                int firstpos = line.IndexOf('\"', spos + 1);
                int lastpos  = line.IndexOf('\"', firstpos + 1);
                i.value = line.Substring(firstpos + 1, lastpos - firstpos - 1);
            }
            else
            {
                i.type = line;
            }
            return(i);
        }
Esempio n. 2
0
        private lineinfo parsestring(string line)
        {
            lineinfo i = new lineinfo();
            if(line.IndexOf("</") == -1)
            {
                i.type = line.Substring(line.IndexOf('<')+1,line.IndexOf(' ')-line.IndexOf('<')-1);
                if (i.type == "var f")
                    i.type = "var";//best hack
            int fpos = line.IndexOf('\"');
            int spos = line.IndexOf('\"',fpos+1);
            i._ref = line.Substring(fpos+1,spos-fpos-1);
            i.line = i._ref.Substring(i._ref.IndexOf(':')+1);
            i._ref = i._ref.Substring(0, i._ref.IndexOf(':'));
            i.name = line.Substring(line.IndexOf('>')+1,line.IndexOf('\r')-line.IndexOf('>')-1);

            }
            else if (line.IndexOf("</val>") != -1)
            {
                i.type = "val";
                int fpos = line.IndexOf('\"');
                int spos = line.IndexOf('\"',fpos+1);
                i._ref = line.Substring(fpos+1,spos-fpos);
                i.line = i._ref.Substring(i._ref.IndexOf(':') + 1, 1);
                i._ref = i._ref.Substring(0, i._ref.IndexOf(':'));
                int firstpos = line.IndexOf('\"', spos+1);
                int lastpos = line.IndexOf('\"',firstpos+1);
                i.value = line.Substring(firstpos+1,lastpos-firstpos-1);
            }
            else
            {
                i.type = line;
            }
            return i;
        }