MultiRecordEngine Class |
This engine allows you to parse and write files that contain records of different types and that are in a linear relationship
(for Master-Detail check the MasterDetailEngine)
Namespace: FileHelpers
The MultiRecordEngine type exposes the following members.
Name | Description | |
---|---|---|
![]() | MultiRecordEngine(Type) | Create a new instance of the MultiRecordEngine |
![]() | MultiRecordEngine(RecordTypeSelector, Type) | Create a new instance of the MultiRecordEngine |
Name | Description | |
---|---|---|
![]() | Encoding |
The encoding to Read and Write the streams.
Default is the system's current ANSI code page.
(Inherited from EngineBase.) |
![]() | ErrorManager | This is a common class that manages the errors of the library. (Inherited from EngineBase.) |
![]() | ErrorMode |
Indicates the behavior of the engine when it finds an error.
{Shortcut for )
(Inherited from EngineBase.) |
![]() | FooterText | The Read Footer in the last Read operation. If any. (Inherited from EngineBase.) |
![]() | HeaderText | The Read Header in the last Read operation. If any. (Inherited from EngineBase.) |
![]() ![]() | LastRecord | Contains the last Record read by the ReadNext method. |
![]() | LineNumber | The current line number. (Inherited from EngineBase.) |
![]() | NewLineForWrite |
Newline string to be used when engine writes to file.
Default is the system's newline setting (System.Environment.NewLine).
(Inherited from EngineBase.) |
![]() | Options |
Allows you to change some record layout options at runtime
(Inherited from EngineBase.) |
![]() | RecordSelector |
The Selector used by the engine in Read operations to determine the Type to use.
|
![]() | RecordType | Returns the type of records handled by this engine. (Inherited from EngineBase.) |
![]() | TotalRecords | The total numbers of records in the last read/written file
(only works with whole read/write). (Inherited from EngineBase.) |
Name | Description | |
---|---|---|
![]() ![]() | AppendToFile(String, IEnumerable) |
Append an array of records to the specified file.
|
![]() ![]() | AppendToFile(String, Object) |
Append a record to the specified file.
|
![]() | BeginAppendToFile | Open a file to be appended at the end. |
![]() | BeginReadFile |
Method used to use this engine in Async mode. Work together with
ReadNext. (Remember to call Close after read the
data)
|
![]() | BeginReadStream(TextReader) |
Read a generic file as delimited by newlines
|
![]() | BeginReadStream(IRecordReader) |
Method used to use this engine in Async mode. Work together with
ReadNext. (Remember to call Close after read the
data)
|
![]() | BeginReadString |
Method used to use this engine in Async mode. Work together with
ReadNext. (Remember to call Close after read the
data)
|
![]() | BeginWriteFile |
Open a file for write operations. If exist the engine override it.
You can use WriteNext(Object) or WriteNexts(IEnumerable) to
write records.
|
![]() | BeginWriteStream | Set the stream to be used in the WriteNext(Object) operation. |
![]() | Close |
Close the underlining Readers and Writers. (if any)
|
![]() | Flush |
Save all the buffered data for write to the disk.
Useful to long opened async engines that wants to save pending
values or for engines used for logging.
|
![]() | GetFileHeader |
Builds a line with the name of the fields, for a delimited files it
uses the same delimiter, for a fixed length field it writes the
fields names separated with tabs
(Inherited from EngineBase.) |
![]() | ReadFile |
Reads a file and returns the records.
|
![]() | ReadNext |
Reads the next record from the source
|
![]() | ReadNexts |
Read a defined number of records from the source
|
![]() | ReadStream(TextReader) |
Read an array of objects from a stream
|
![]() ![]() | ReadStream(IRecordReader) |
Read a Stream and return an array of the contained records.
|
![]() | ReadString |
Read a String and return an array of the contained records.
|
![]() ![]() | WriteFile(String, IEnumerable) |
Write an array of records to the specified file.
|
![]() ![]() | WriteFile(String, IEnumerable, Int32) |
Write the specified number of records from the array to a file.
|
![]() | WriteNext |
Write the next record to a file or stream opened with
BeginWriteFile(String), BeginWriteStream(TextWriter) or
BeginAppendToFile(String) method.
|
![]() | WriteNexts |
Write the nexts records to a file or stream opened with
BeginWriteFile(String), BeginWriteStream(TextWriter) or
BeginAppendToFile(String) method.
|
![]() | WriteStream(TextWriter, IEnumerable) |
Write the records to a file
|
![]() ![]() | WriteStream(TextWriter, IEnumerable, Int32) |
Write the specified number of records in the array to the Stream.
|
![]() | WriteString(IEnumerable) |
Write an array of records to an String and return it.
|
![]() | WriteString(IEnumerable, Int32) |
Write an array of records to an String and return it.
|
Name | Description | |
---|---|---|
![]() | AfterReadRecord |
Called in read operations just after the record was created from a
record string.
(Inherited from EventEngineBaseT.) |
![]() | AfterWriteRecord |
Called in write operations just after the record was converted to a
string.
(Inherited from EventEngineBaseT.) |
![]() | BeforeReadRecord |
Called in read operations just before the record string is
translated to a record.
(Inherited from EventEngineBaseT.) |
![]() | BeforeWriteRecord |
Called in write operations just before the record is converted to a
string to write it.
(Inherited from EventEngineBaseT.) |
![]() | Progress | Event handler called to notify progress. (Inherited from EngineBase.) |