C# Класс LumenWorks.Framework.IO.Csv.CachedCsvReader

Represents a reader that provides fast, cached, dynamic access to CSV data.
The number of records is limited to System.Int32.MaxValue - 1.
Наследование: CsvReader, IListSource
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
IListSource System.Collections.IList

Открытые методы

Метод Описание
CachedCsvReader ( TextReader reader, bool hasHeaders ) : System

Initializes a new instance of the CsvReader class.

CachedCsvReader ( TextReader reader, bool hasHeaders, char delimiter ) : System

Initializes a new instance of the CsvReader class.

CachedCsvReader ( TextReader reader, bool hasHeaders, char delimiter, char quote, char escape, char comment, ValueTrimmingOptions trimmingOptions, int bufferSize, string nullValue = null ) : System

Initializes a new instance of the CsvReader class.

CachedCsvReader ( TextReader reader, bool hasHeaders, char delimiter, char quote, char escape, char comment, ValueTrimmingOptions trimmingOptions, string nullValue = null ) : System

Initializes a new instance of the CsvReader class.

CachedCsvReader ( TextReader reader, bool hasHeaders, char delimiter, int bufferSize ) : System

Initializes a new instance of the CsvReader class.

CachedCsvReader ( TextReader reader, bool hasHeaders, int bufferSize ) : System

Initializes a new instance of the CsvReader class.

MoveTo ( long record ) : bool

Moves to the specified record index.

MoveToLastCachedRecord ( ) : void

Moves to the last record read so far.

MoveToStart ( ) : void

Moves before the first record.

ReadToEnd ( ) : void

Reads the CSV stream from the current position to the end of the stream.

this ( int field ) : string

Gets the field at the specified index.

Защищенные методы

Метод Описание
ReadNextRecord ( bool onlyReadHeaders, bool skipToNextLine ) : bool

Reads the next record.

Приватные методы

Метод Описание
IListSource ( ) : System.Collections.IList

Описание методов

CachedCsvReader() публичный Метод

Initializes a new instance of the CsvReader class.
/// is a . /// /// Cannot read from . ///
public CachedCsvReader ( TextReader reader, bool hasHeaders ) : System
reader System.IO.TextReader A pointing to the CSV file.
hasHeaders bool if field names are located on the first non commented line, otherwise, .
Результат System

CachedCsvReader() публичный Метод

Initializes a new instance of the CsvReader class.
/// is a . /// /// Cannot read from . ///
public CachedCsvReader ( TextReader reader, bool hasHeaders, char delimiter ) : System
reader System.IO.TextReader A pointing to the CSV file.
hasHeaders bool if field names are located on the first non commented line, otherwise, .
delimiter char The delimiter character separating each field (default is ',').
Результат System

CachedCsvReader() публичный Метод

Initializes a new instance of the CsvReader class.
/// is a . /// /// must be 1 or more. ///
public CachedCsvReader ( TextReader reader, bool hasHeaders, char delimiter, char quote, char escape, char comment, ValueTrimmingOptions trimmingOptions, int bufferSize, string nullValue = null ) : System
reader System.IO.TextReader A pointing to the CSV file.
hasHeaders bool if field names are located on the first non commented line, otherwise, .
delimiter char The delimiter character separating each field (default is ',').
quote char The quotation character wrapping every field (default is ''').
escape char /// The escape character letting insert quotation characters inside a quoted field (default is '\'). /// If no escape character, set to '\0' to gain some performance. ///
comment char The comment character indicating that a line is commented out (default is '#').
trimmingOptions ValueTrimmingOptions Determines how values should be trimmed.
bufferSize int The buffer size in bytes.
nullValue string The value which denotes a DbNull-value.
Результат System

CachedCsvReader() публичный Метод

Initializes a new instance of the CsvReader class.
/// is a . /// /// Cannot read from . ///
public CachedCsvReader ( TextReader reader, bool hasHeaders, char delimiter, char quote, char escape, char comment, ValueTrimmingOptions trimmingOptions, string nullValue = null ) : System
reader System.IO.TextReader A pointing to the CSV file.
hasHeaders bool if field names are located on the first non commented line, otherwise, .
delimiter char The delimiter character separating each field (default is ',').
quote char The quotation character wrapping every field (default is ''').
escape char /// The escape character letting insert quotation characters inside a quoted field (default is '\'). /// If no escape character, set to '\0' to gain some performance. ///
comment char The comment character indicating that a line is commented out (default is '#').
trimmingOptions ValueTrimmingOptions Determines how values should be trimmed.
nullValue string The value which denotes a DbNull-value.
Результат System

CachedCsvReader() публичный Метод

Initializes a new instance of the CsvReader class.
/// is a . /// /// Cannot read from . ///
public CachedCsvReader ( TextReader reader, bool hasHeaders, char delimiter, int bufferSize ) : System
reader System.IO.TextReader A pointing to the CSV file.
hasHeaders bool if field names are located on the first non commented line, otherwise, .
delimiter char The delimiter character separating each field (default is ',').
bufferSize int The buffer size in bytes.
Результат System

CachedCsvReader() публичный Метод

Initializes a new instance of the CsvReader class.
/// is a . /// /// Cannot read from . ///
public CachedCsvReader ( TextReader reader, bool hasHeaders, int bufferSize ) : System
reader System.IO.TextReader A pointing to the CSV file.
hasHeaders bool if field names are located on the first non commented line, otherwise, .
bufferSize int The buffer size in bytes.
Результат System

MoveTo() публичный Метод

Moves to the specified record index.
/// The instance has been disposed of. ///
public MoveTo ( long record ) : bool
record long The record index.
Результат bool

MoveToLastCachedRecord() публичный Метод

Moves to the last record read so far.
public MoveToLastCachedRecord ( ) : void
Результат void

MoveToStart() публичный Метод

Moves before the first record.
public MoveToStart ( ) : void
Результат void

ReadNextRecord() защищенный Метод

Reads the next record.
/// The instance has been disposed of. ///
protected ReadNextRecord ( bool onlyReadHeaders, bool skipToNextLine ) : bool
onlyReadHeaders bool /// Indicates if the reader will proceed to the next record after having read headers. /// if it stops after having read headers; otherwise, . ///
skipToNextLine bool /// Indicates if the reader will skip directly to the next line without parsing the current one. /// To be used when an error occurs. ///
Результат bool

ReadToEnd() публичный Метод

Reads the CSV stream from the current position to the end of the stream.
/// The instance has been disposed of. ///
public ReadToEnd ( ) : void
Результат void

this() публичный Метод

Gets the field at the specified index.
/// must be included in [0, [. /// /// No record read yet. Call ReadLine() first. /// /// The CSV data appears to be missing a field. /// /// The CSV appears to be corrupt at the current position. /// /// The instance has been disposed of. ///
public this ( int field ) : string
field int
Результат string