From 6141a763ae1cdc075bf531fe512a4f50c97c3f03 Mon Sep 17 00:00:00 2001 From: Austin Noska Date: Tue, 5 Jan 2021 10:04:41 -0500 Subject: [PATCH] Refactor: remove unused code in CsvWriter.cs --- ICD.Common.Utils/Csv/CsvWriter.cs | 56 ++++--------------------------- 1 file changed, 6 insertions(+), 50 deletions(-) diff --git a/ICD.Common.Utils/Csv/CsvWriter.cs b/ICD.Common.Utils/Csv/CsvWriter.cs index 1a79e00..ea94acd 100644 --- a/ICD.Common.Utils/Csv/CsvWriter.cs +++ b/ICD.Common.Utils/Csv/CsvWriter.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using ICD.Common.Properties; using ICD.Common.Utils.IO; @@ -12,6 +11,10 @@ namespace ICD.Common.Utils.Csv private readonly IcdTextWriter m_Writer; private readonly CsvWriterSettings m_Settings; + + /// + /// Are we currently at the beginning of a new line? + /// private bool m_NewLine; #region Properties @@ -27,7 +30,8 @@ namespace ICD.Common.Utils.Csv /// /// Constructor. /// - public CsvWriter([NotNull] IcdTextWriter writer, [NotNull] CsvWriterSettings settings, [NotNull] params string[] header) + public CsvWriter([NotNull] IcdTextWriter writer, + [NotNull] CsvWriterSettings settings) { if (writer == null) throw new ArgumentNullException("writer"); @@ -35,46 +39,9 @@ namespace ICD.Common.Utils.Csv if (settings == null) throw new ArgumentNullException("settings"); - if (header == null) - throw new ArgumentNullException("header"); - m_NewLine = true; m_Writer = writer; m_Settings = settings; - - if (header.Any()) - AppendRow(header); - } - - /// - /// Deconstructor. - /// - ~CsvWriter() - { - Dispose(); - } - - /// - /// Instantiates a new CsvWriter with the properties given in the CsvWriterSettings. - /// - /// - /// - /// - /// - [PublicAPI] - public static CsvWriter Create([NotNull] IcdTextWriter writer, [NotNull] CsvWriterSettings settings, - [NotNull] params string[] header) - { - if (writer == null) - throw new ArgumentNullException("writer"); - - if (settings == null) - throw new ArgumentNullException("settings"); - - if (header == null) - throw new ArgumentNullException("header"); - - return new CsvWriter(writer, settings, header); } #endregion @@ -86,17 +53,6 @@ namespace ICD.Common.Utils.Csv #region Methods - /// - /// Calls ToString() for each item and adds the row to the builder. - /// - /// - [PublicAPI] - public void AppendRow(params object[] row) - { - foreach (object value in row) - AppendValue(value); - AppendNewline(); - } /// /// Adds the row to the builder.