Skip to content

Commit

Permalink
Updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RNoeldner committed Sep 9, 2024
1 parent db4232c commit f8e5b5e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 17 deletions.
21 changes: 16 additions & 5 deletions Library/ClassLibraryCSV/Detection/DetectionHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ public static class DetectionHeader
/// <summary>
/// Helper method to read columns from the file, taking care of commented Lines
/// </summary>
/// <param name="reader"></param>
/// <param name="fieldDelimiter"></param>
/// <param name="fieldQualifier"></param>
/// <param name="escapePrefix"></param>
/// <param name="commentLine"></param>
/// <param name="reader">The reader.</param>
/// <param name="fieldDelimiter">The delimiter to separate columns</param>
/// <param name="fieldQualifier">>Qualifier / Quoting of column to allow delimiter or linefeed to be contained in column</param>
/// <param name="escapePrefix">The start of an escape sequence to allow delimiter or qualifier in column</param>
/// <param name="commentLine">The lineComment.</param>
/// <returns>All columns of the next row</returns>
public static ICollection<string> DelimitedRecord(in ImprovedTextReader reader, char fieldDelimiter,
char fieldQualifier, char escapePrefix, string commentLine)
Expand Down Expand Up @@ -255,6 +255,17 @@ private static async Task<string> InspectHeaderLineAsync(ImprovedTextReader read
return headerLine;
}

/// <summary>
/// Get the raw header rows(s) from a text file, without any corrections
/// </summary>
/// <param name="stream"></param>
/// <param name="codePageId">The code page identifier. UTF8 is 65001</param>
/// <param name="skipLines">Number of lines that should be skipped at the beginning of the file</param>
/// <param name="fieldDelimiterChar">The delimiter to separate columns</param>
/// <param name="fieldQualifierChar">Qualifier / Quoting of column to allow delimiter or linefeed to be contained in column</param>
/// <param name="escapePrefix">The start of an escape sequence to allow delimiter or qualifier in column</param>
/// <param name="commentLine">The lineComment.</param>
/// <returns></returns>
public static string GetRawHeaderLine(this Stream stream, int codePageId, int skipLines,
char fieldDelimiterChar,
char fieldQualifierChar, char escapePrefix, string commentLine)
Expand Down
2 changes: 1 addition & 1 deletion Library/ClassLibraryCSV/Detection/DetectionLineComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static class DetectionLineComment
/// <summary>Checks if the comment line does make sense, or if its possibly better regarded as header row</summary>
/// <param name="textReader">The text reader to read the data</param>
/// <param name="commentLine">The characters for a comment line.</param>
/// <param name="fieldDelimiterChar">The delimiter.</param>
/// <param name="fieldDelimiterChar">The delimiter to separate columns</param>
/// <param name="cancellationToken">Cancellation token to stop a possibly long running process</param>
/// <returns>true if the comment line seems to be ok</returns>
public static async Task<bool> InspectLineCommentIsValidAsync(
Expand Down
4 changes: 2 additions & 2 deletions Library/ClassLibraryCSV/Detection/DetectionStartRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public static class DetectionStartRow
/// Guess the start row of a CSV file done with a rather simple csv parsing, excluding any header rows or commented rows.
/// </summary>
/// <param name="textReader">The text reader to read the data</param>
/// <param name="fieldDelimiterChar">The delimiter.</param>
/// <param name="fieldQualifierChar">The quoting char</param>
/// <param name="fieldDelimiterChar">The delimiter to separate columns</param>
/// <param name="fieldQualifierChar">Qualifier for columns that might contain characters that need quoting</param>
/// <param name="escapePrefixChar">The start of an escape sequence to allow delimiter or qualifier in column</param>
/// <param name="commentLine">The characters for a comment line.</param>
/// <param name="cancellationToken">Cancellation token to stop a possibly long running process</param>
Expand Down
2 changes: 1 addition & 1 deletion Library/ClassLibraryCSV/FileReader/CsvFileReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public CsvFileReader(in Stream stream, int codePageId, int skipRows,
/// <param name="columnDefinition">The column definition for value conversion.</param>
/// <param name="trimmingOption">How should leading/trailing spaces be trimmed?. Option based on information whether the text is quoted or not</param>
/// <param name="fieldDelimiterChar">The field delimiter character.</param>
/// <param name="fieldQualifierChar">The field qualifier character.</param>
/// <param name="fieldQualifierChar">Qualifier for columns that might contain characters that need quoting.</param>
/// <param name="escapeCharacterChar">The escape character an escaped chars is read as is, 2nd method to have quotes or delimiter in column.</param>
/// <param name="recordLimit">After the giving number of records stop reading</param>
/// <param name="allowRowCombining">if set to <c>true</c> try to combine rows, assuming not properly quoted the content of a columns has pushed data to next line</param>
Expand Down
4 changes: 2 additions & 2 deletions Library/ClassLibraryCSV/FileWriter/CsvFileWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public sealed class CsvFileWriter : BaseFileWriter
/// <param name="header">Header to be written before data and/or Header is written</param>
/// <param name="fileSettingDisplay">Info text for logging and process report</param>
/// <param name="newLine"><see cref="RecordDelimiterTypeEnum"/> written after each record</param>
/// <param name="fieldDelimiterChar">Column / Field delimiter, if empty the text will be written as fixed length</param>
/// <param name="fieldDelimiterChar">The delimiter to separate columns, if empty the text will be written as fixed length</param>
/// <param name="fieldQualifierChar">Qualifier for columns that might contain characters that need quoting</param>
/// <param name="escapePrefixChar">Escape char to include otherwise protected characters </param>
/// <param name="newLinePlaceholder">Placeholder for a NewLine being part of a text, instead of the new line this text will be written</param>
Expand Down Expand Up @@ -98,7 +98,7 @@ public CsvFileWriter(
in string sourceTimeZone = "",
in string publicKey = "",
bool unencrypted = false
)
)
: base(
fullPath,
valueFormat, identifierInContainer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Compile Include="..\UnitTestBasic\UnitTestStaticForms.cs" Link="UnitTestStaticForms.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MSTest" Version="3.5.0" />
<PackageReference Include="MSTest" Version="3.5.2" />
<ProjectReference Include="..\..\Application\CSVQuickViewer.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest" Version="3.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="MSTest" Version="3.5.2" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
<ProjectReference Include="..\..\Library\ClassLibraryCSV\CsvTools.ClassLibraryCSV.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="MSTest" Version="3.5.0" />
<PackageReference Include="MSTest" Version="3.5.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Library\WinFormControls\CsvTools.WinFormControlsLibrary.csproj" />
Expand Down

0 comments on commit f8e5b5e

Please sign in to comment.