-
Notifications
You must be signed in to change notification settings - Fork 0
DiGi.Core.IO.DelimitedData.Classes
Reader for delimited data files.
public class DelimitedDataReader : System.IO.StreamReader, DiGi.Core.IO.DelimitedData.Interfaces.IDelimitedDataReaderInheritance System.Object → System.MarshalByRefObject → System.IO.TextReader → System.IO.StreamReader → DelimitedDataReader
Implements IDelimitedDataReader
Initializes a new instance of the DelimitedDataReader class.
public DelimitedDataReader(char separator, string path);separator System.Char
The character to use as the separator.
path System.String
The path to the file containing the delimited data.
Initializes a new instance of the DelimitedDataReader class.
public DelimitedDataReader(char separator, System.Collections.Generic.IEnumerable<string> lines);separator System.Char
The character to use as the separator.
lines System.Collections.Generic.IEnumerable<System.String>
The collection of lines containing the delimited data.
Initializes a new instance of the DelimitedDataReader class.
public DelimitedDataReader(char separator, System.IO.Stream stream);separator System.Char
The character used as a separator.
stream System.IO.Stream
The stream to read from.
Initializes a new instance of the DelimitedDataReader class.
public DelimitedDataReader(DiGi.Core.IO.DelimitedData.Enums.DelimitedDataSeparator delimitedDataSeparator, string path);delimitedDataSeparator DelimitedDataSeparator
The separator to use for delimited data.
path System.String
The path to the file containing the delimited data.
Initializes a new instance of the DelimitedDataReader class.
public DelimitedDataReader(DiGi.Core.IO.DelimitedData.Enums.DelimitedDataSeparator delimitedDataSeparator, string path, System.Text.Encoding encoding);delimitedDataSeparator DelimitedDataSeparator
The separator to use for delimited data.
path System.String
The path to the file containing the delimited data.
encoding System.Text.Encoding
The encoding to use when reading the file.
Initializes a new instance of the DelimitedDataReader class.
public DelimitedDataReader(DiGi.Core.IO.DelimitedData.Enums.DelimitedDataSeparator delimitedDataSeparator, System.Collections.Generic.IEnumerable<string> lines);delimitedDataSeparator DelimitedDataSeparator
The separator to use for delimited data.
lines System.Collections.Generic.IEnumerable<System.String>
The collection of lines containing the delimited data.
Gets the character used as a separator in the delimited data file.
public char Separator { get; }Implements Separator
Reads a row of data from a CSV file
public DiGi.Core.IO.DelimitedData.Classes.DelimitedDataRow? ReadRow();Implements ReadRow()
DelimitedDataRow
DelimitedDataRow
Reads a rows of data from a CSV file
public System.Collections.Generic.List<DiGi.Core.IO.DelimitedData.Classes.DelimitedDataRow> ReadRows();Implements ReadRows()
System.Collections.Generic.List<DelimitedDataRow>
List of the rows
Class to store one delimited file row
public class DelimitedDataRow : System.Collections.Generic.List<string>Inheritance System.Object → System.Collections.Generic.List<System.String> → DelimitedDataRow
Initializes a new instance of the DelimitedDataRow class.
public DelimitedDataRow();Initializes a new instance of the DelimitedDataRow class.
public DelimitedDataRow(System.Collections.Generic.IEnumerable<string>? values);values System.Collections.Generic.IEnumerable<System.String>
The collection of string values to initialize the row with.
Tries to get the value at the specified index as a specific type.
public bool TryGetValue<T>(int index, out T? value);T
The type of the value to retrieve.
index System.Int32
The zero-based index of the element to get.
value T
When this method returns, contains the value at the specified index if the operation was successful; otherwise, the default value for the type of the element.
System.Boolean
True if the element is successfully retrieved; otherwise, false.
Writer for delimited data files.
public class DelimitedDataWriter : System.IO.StreamWriter, DiGi.Core.IO.DelimitedData.Interfaces.IDelimitedDataWriterInheritance System.Object → System.MarshalByRefObject → System.IO.TextWriter → System.IO.StreamWriter → DelimitedDataWriter
Implements IDelimitedDataWriter
Initializes a new instance of the DelimitedDataWriter class.
public DelimitedDataWriter(char separator, string path);separator System.Char
The character to use as a separator.
path System.String
The path to the file where data will be written.
Initializes a new instance of the DelimitedDataWriter class.
public DelimitedDataWriter(char separator, System.IO.Stream stream);separator System.Char
The character to use as a separator.
stream System.IO.Stream
The stream where data will be written.
Initializes a new instance of the DelimitedDataWriter class.
public DelimitedDataWriter(DiGi.Core.IO.DelimitedData.Enums.DelimitedDataSeparator delimitedDataSeparator, string path);delimitedDataSeparator DelimitedDataSeparator
The separator to use for delimited data.
path System.String
The path to the file where data will be written.
Gets the character used as a separator in the delimited data file.
public char Separator { get; }Implements Separator
Writes a single row to a CSV file.
public void WriteRow(DiGi.Core.IO.DelimitedData.Classes.DelimitedDataRow? delimitedDataRow);delimitedDataRow DelimitedDataRow
The row to be written
Implements WriteRow(DelimitedDataRow)
Writes a rows to a CSV file.
public void WriteRows(System.Collections.Generic.IEnumerable<DiGi.Core.IO.DelimitedData.Classes.DelimitedDataRow>? delimitedDataRows);delimitedDataRows System.Collections.Generic.IEnumerable<DelimitedDataRow>
The rows to be written
Implements WriteRows(IEnumerable<DelimitedDataRow>)