Example #1
0
File: Tools.cs Project: ikvm/test
        public static ArrayList getVector(string str, char delim, bool removeEsc)
        {
            ArrayList list = new ArrayList(10);

            if (str != null)
            {
                ArgToken token = new ArgToken(str, delim);
                while (token.hasMoreTokens())
                {
                    string str2 = token.nextToken();
                    if (removeEsc)
                    {
                        str2 = Escape.removeEscAndQuote(str2);
                    }
                    if (!isValidString(str2))
                    {
                        list.Add("");
                    }
                    else
                    {
                        list.Add(str2);
                    }
                }
            }
            return(list);
        }
Example #2
0
        public Arg(string segStr)
        {
            ArgToken token = new ArgToken(segStr, ',');

            while (token.hasNext())
            {
                string str = token.next();
                if (str.StartsWith("en="))
                {
                    this.enName = Escape.removeEscAndQuote(str.Substring(3));
                }
                else
                {
                    if (!str.StartsWith("ch="))
                    {
                        if (str.StartsWith("tp="))
                        {
                            this.type = str.Substring(3);
                        }
                        else if (!str.StartsWith("w="))
                        {
                            if (!str.StartsWith("fmt="))
                            {
                                if (str.StartsWith("val="))
                                {
                                    this.value_Renamed = Escape.removeEscAndQuote(str.Substring(4));
                                }
                            }
                            else
                            {
                                this.fmt = Escape.removeEscAndQuote(str.Substring(4));
                            }
                        }
                        else
                        {
                            this.width = str.Substring(2);
                        }
                        continue;
                    }
                    this.chName = Escape.removeEscAndQuote(str.Substring(3));
                }
            }
        }