C# Class Malevich.StreamCombiner

Implements a TextReader-like class that (only two methods though: ReadLine and Close) that wraps around either a TextReader, or a bunch of diffs.
Inheritance: IDisposable
Show file Open project: daptiv/Malevich Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Frees all the resources.

ReadLine ( ) : string

Read one line of input.

ReadLines ( ) : IEnumerable

Used to enumerate every line in the stream until EOF.

StreamCombiner ( TextReader baseReader ) : System

The wrapper case - just wraps a TextReader. Will Close it on Close. Nothing intelligent.

StreamCombiner ( string baseText ) : System

The wrapper case - just wraps a string.

StreamCombiner ( string baseText, string diffText ) : System

Constructor for file and a diff case. This is where the meat of this class is used.

Private Methods

Method Description
IDisposable ( ) : void

Closes the stream.

ParseDiffLine ( string text ) : int

Parses a line from the diff file which specifies the next line where the next diff section starts.

Method Details

Close() public method

Frees all the resources.
public Close ( ) : void
return void

ReadLine() public method

Read one line of input.
public ReadLine ( ) : string
return string

ReadLines() public method

Used to enumerate every line in the stream until EOF.
public ReadLines ( ) : IEnumerable
return IEnumerable

StreamCombiner() public method

The wrapper case - just wraps a TextReader. Will Close it on Close. Nothing intelligent.
public StreamCombiner ( TextReader baseReader ) : System
baseReader TextReader TextReader to wrap.
return System

StreamCombiner() public method

The wrapper case - just wraps a string.
public StreamCombiner ( string baseText ) : System
baseText string The string to wrap.
return System

StreamCombiner() public method

Constructor for file and a diff case. This is where the meat of this class is used.
public StreamCombiner ( string baseText, string diffText ) : System
baseText string The base of the file.
diffText string The diff.
return System