Lean  $LEAN_TAG$
QuantConnect.ToolBox.LazyStreamWriter Class Reference

This class wraps a StreamWriter so that the StreamWriter is only instantiated until WriteLine() is called. This ensures that the file the StreamWriter is writing to is only created if something is written to it. A StreamWriter will create a empty file as soon as it is instantiated. More...

Public Member Functions

 LazyStreamWriter (string path)
 Constructor for the LazyStreamWriter More...
 
void WriteLine (string line)
 Wraps the WriteLine method of the StreamWriter. More...
 
void Flush ()
 Wraps the StreamWriter.Flush() method More...
 
void Close ()
 Wraps the StreamWriter.Close() method More...
 

Detailed Description

This class wraps a StreamWriter so that the StreamWriter is only instantiated until WriteLine() is called. This ensures that the file the StreamWriter is writing to is only created if something is written to it. A StreamWriter will create a empty file as soon as it is instantiated.

Definition at line 25 of file LazyStreamWriter.cs.

Constructor & Destructor Documentation

◆ LazyStreamWriter()

QuantConnect.ToolBox.LazyStreamWriter.LazyStreamWriter ( string  path)

Constructor for the LazyStreamWriter

Parameters
pathPath to the file that should be created

Definition at line 34 of file LazyStreamWriter.cs.

Member Function Documentation

◆ WriteLine()

void QuantConnect.ToolBox.LazyStreamWriter.WriteLine ( string  line)

Wraps the WriteLine method of the StreamWriter.

Parameters
lineThe line to write

Will instantiate the StreamWriter if this is the first time this method is called

Definition at line 44 of file LazyStreamWriter.cs.

Here is the caller graph for this function:

◆ Flush()

void QuantConnect.ToolBox.LazyStreamWriter.Flush ( )

Wraps the StreamWriter.Flush() method

Definition at line 54 of file LazyStreamWriter.cs.

Here is the caller graph for this function:

◆ Close()

void QuantConnect.ToolBox.LazyStreamWriter.Close ( )

Wraps the StreamWriter.Close() method

Definition at line 65 of file LazyStreamWriter.cs.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: