1- using CsvHelper ;
2-
3- using LogExpert ;
4-
5- using Newtonsoft . Json ;
6-
71using System ;
82using System . Collections . Generic ;
93using System . IO ;
126using System . Runtime . Versioning ;
137using System . Windows . Forms ;
148
9+ using CsvHelper ;
10+
11+ using LogExpert ;
12+
13+ using Newtonsoft . Json ;
14+
1515[ assembly: SupportedOSPlatform ( "windows" ) ]
1616namespace CsvColumnizer ;
1717
@@ -24,7 +24,7 @@ public class CsvColumnizer : ILogLineColumnizer, IInitColumnizer, IColumnizerCon
2424{
2525 #region Fields
2626
27- private static readonly string _configFileName = "csvcolumnizer.json" ;
27+ private const string CONFIGFILENAME = "csvcolumnizer.json" ;
2828
2929 private readonly IList < CsvColumn > _columnList = [ ] ;
3030 private CsvColumnizerConfig _config ;
@@ -38,7 +38,7 @@ public class CsvColumnizer : ILogLineColumnizer, IInitColumnizer, IColumnizerCon
3838
3939 #region Public methods
4040
41- public string PreProcessLine ( string logLine , int lineNum , int realLineNum )
41+ public string PreProcessLine ( string logLine , int lineNum , int realLineNum )
4242 {
4343 if ( realLineNum == 0 )
4444 {
@@ -72,22 +72,22 @@ public string PreProcessLine(string logLine, int lineNum, int realLineNum)
7272 return logLine ;
7373 }
7474
75- public string GetName ( )
75+ public string GetName ( )
7676 {
7777 return "CSV Columnizer" ;
7878 }
7979
80- public string GetDescription ( )
80+ public string GetDescription ( )
8181 {
8282 return "Splits CSV files into columns.\r \n \r \n Credits:\r \n This Columnizer uses the CsvHelper. https://github.com/JoshClose/CsvHelper. \r \n " ;
8383 }
8484
85- public int GetColumnCount ( )
85+ public int GetColumnCount ( )
8686 {
8787 return _isValidCsv ? _columnList . Count : 1 ;
8888 }
8989
90- public string [ ] GetColumnNames ( )
90+ public string [ ] GetColumnNames ( )
9191 {
9292 var names = new string [ GetColumnCount ( ) ] ;
9393 if ( _isValidCsv )
@@ -106,7 +106,7 @@ public string[] GetColumnNames()
106106 return names ;
107107 }
108108
109- public IColumnizedLogLine SplitLine ( ILogLineColumnizerCallback callback , ILogLine line )
109+ public IColumnizedLogLine SplitLine ( ILogLineColumnizerCallback callback , ILogLine line )
110110 {
111111 if ( _isValidCsv )
112112 {
@@ -116,7 +116,7 @@ public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLin
116116 return CreateColumnizedLogLine ( line ) ;
117117 }
118118
119- private static ColumnizedLogLine CreateColumnizedLogLine ( ILogLine line )
119+ private static ColumnizedLogLine CreateColumnizedLogLine ( ILogLine line )
120120 {
121121 ColumnizedLogLine cLogLine = new ( )
122122 {
@@ -126,32 +126,32 @@ private static ColumnizedLogLine CreateColumnizedLogLine(ILogLine line)
126126 return cLogLine ;
127127 }
128128
129- public bool IsTimeshiftImplemented ( )
129+ public bool IsTimeshiftImplemented ( )
130130 {
131131 return false ;
132132 }
133133
134- public void SetTimeOffset ( int msecOffset )
134+ public void SetTimeOffset ( int msecOffset )
135135 {
136136 throw new NotImplementedException ( ) ;
137137 }
138138
139- public int GetTimeOffset ( )
139+ public int GetTimeOffset ( )
140140 {
141141 throw new NotImplementedException ( ) ;
142142 }
143143
144- public DateTime GetTimestamp ( ILogLineColumnizerCallback callback , ILogLine line )
144+ public DateTime GetTimestamp ( ILogLineColumnizerCallback callback , ILogLine line )
145145 {
146146 throw new NotImplementedException ( ) ;
147147 }
148148
149- public void PushValue ( ILogLineColumnizerCallback callback , int column , string value , string oldValue )
149+ public void PushValue ( ILogLineColumnizerCallback callback , int column , string value , string oldValue )
150150 {
151151 throw new NotImplementedException ( ) ;
152152 }
153153
154- public void Selected ( ILogLineColumnizerCallback callback )
154+ public void Selected ( ILogLineColumnizerCallback callback )
155155 {
156156 if ( _isValidCsv ) // see PreProcessLine()
157157 {
@@ -186,14 +186,14 @@ public void Selected(ILogLineColumnizerCallback callback)
186186 }
187187 }
188188
189- public void DeSelected ( ILogLineColumnizerCallback callback )
189+ public void DeSelected ( ILogLineColumnizerCallback callback )
190190 {
191191 // nothing to do
192192 }
193193
194- public void Configure ( ILogLineColumnizerCallback callback , string configDir )
194+ public void Configure ( ILogLineColumnizerCallback callback , string configDir )
195195 {
196- var configPath = configDir + "\\ " + _configFileName ;
196+ var configPath = configDir + "\\ " + CONFIGFILENAME ;
197197 FileInfo fileInfo = new ( configPath ) ;
198198
199199 CsvColumnizerConfigDlg dlg = new ( _config ) ;
@@ -214,9 +214,9 @@ public void Configure(ILogLineColumnizerCallback callback, string configDir)
214214 }
215215 }
216216
217- public void LoadConfig ( string configDir )
217+ public void LoadConfig ( string configDir )
218218 {
219- var configPath = Path . Combine ( configDir , _configFileName ) ;
219+ var configPath = Path . Combine ( configDir , CONFIGFILENAME ) ;
220220
221221 if ( ! File . Exists ( configPath ) )
222222 {
@@ -239,7 +239,7 @@ public void LoadConfig(string configDir)
239239 }
240240 }
241241
242- public Priority GetPriority ( string fileName , IEnumerable < ILogLine > samples )
242+ public Priority GetPriority ( string fileName , IEnumerable < ILogLine > samples )
243243 {
244244 Priority result = Priority . NotSupport ;
245245
@@ -255,7 +255,7 @@ public Priority GetPriority(string fileName, IEnumerable<ILogLine> samples)
255255
256256 #region Private Methods
257257
258- private IColumnizedLogLine SplitCsvLine ( ILogLine line )
258+ private IColumnizedLogLine SplitCsvLine ( ILogLine line )
259259 {
260260 ColumnizedLogLine cLogLine = new ( )
261261 {
0 commit comments