Ejemplo n.º 1
0
        /**
         * Connect to a file. Open a StreamReader on the file and parse its contents.
         */
        public ListOfTuples connectToFile(string path)
        {
            string        line;
            Tuple         inputTuple;
            List <string> listItems;
            ListOfTuples  result = new ListOfTuples();

            System.IO.StreamReader file = new System.IO.StreamReader("..\\..\\doc\\" + path);

            while ((line = file.ReadLine()) != null)
            {
                if (line.Length != 0)
                {
                    listItems = new List <string>();
                    if ((!String.Equals(line[0].ToString(), "%")))
                    {
                        string[] fields = line.Split(',');
                        foreach (string item in fields)
                        {
                            listItems.Add(item.Trim(' ').Trim('"'));
                        }
                        inputTuple = new Tuple(listItems);
                        result.addToList(inputTuple);
                    }
                }
            }
            file.Close();
            return(result);
        }
Ejemplo n.º 2
0
 public void addToList(ListOfTuples list)
 {
     for (int i = 0; i < list.tuplesArray.Count; i++)
     {
         addToList(list.tuplesArray[i]);
     }
 }
Ejemplo n.º 3
0
 public void addToInputTuples(ListOfTuples tuples)
 {
     input.addToList(tuples);
 }