Example #1
0
        /// <summary>
        /// Returns a string representing the contents of the Ibis file.
        /// </summary>
        /// <returns></returns>
        public string Write()
        {
            LineNumberCounter counter = new LineNumberCounter();
            StringBuilder sb = new StringBuilder();

            // Write the header line
            sb.AppendLine(WriteLine("H", counter.Next, GetHeaderDataItems()));

            // Write out each line
            foreach (IIbisFileLine line in GetLines())
            {
                sb.AppendLine(WriteLine(line.GetLineTypeIdentifier(), counter.Next, line.GetDataItems()));
            }

            // Write the footer line
            sb.AppendLine(WriteLine("T", counter.Next, GetFooterDataItems()));

            return sb.ToString();
        }
Example #2
0
        /// <summary>
        /// Returns a string representing the contents of the Ibis file.
        /// </summary>
        /// <returns></returns>
        public string Write()
        {
            LineNumberCounter counter = new LineNumberCounter();
            StringBuilder     sb      = new StringBuilder();

            // Write the header line
            sb.AppendLine(WriteLine("H", counter.Next, GetHeaderDataItems()));

            // Write out each line
            foreach (IIbisFileLine line in GetLines())
            {
                sb.AppendLine(WriteLine(line.GetLineTypeIdentifier(), counter.Next, line.GetDataItems()));
            }

            // Write the footer line
            sb.AppendLine(WriteLine("T", counter.Next, GetFooterDataItems()));

            return(sb.ToString());
        }