Lean  $LEAN_TAG$
QuantConnect.Util.StreamReaderExtensions Class Reference

Extension methods to fetch data from a StreamReader instance More...

Static Public Member Functions

static decimal GetDecimal (this StreamReader stream, char delimiter=DefaultDelimiter)
 Gets a decimal from the provided stream reader More...
 
static decimal GetDecimal (this StreamReader stream, out bool pastEndLine, char delimiter=DefaultDelimiter)
 Gets a decimal from the provided stream reader More...
 
static DateTime GetDateTime (this StreamReader stream, string format=DateFormat.TwelveCharacter, char delimiter=DefaultDelimiter)
 Gets a date time instance from a stream reader More...
 
static int GetInt32 (this StreamReader stream, char delimiter=DefaultDelimiter)
 Gets an integer from a stream reader More...
 
static string GetString (this StreamReader stream, char delimiter=DefaultDelimiter)
 Gets a string from a stream reader More...
 

Detailed Description

Extension methods to fetch data from a StreamReader instance

The value of these methods is performance. The objective is to avoid using StreamReader.ReadLine and having to create intermediate substrings, parsing and splitting

Definition at line 30 of file StreamReaderExtensions.cs.

Member Function Documentation

◆ GetDecimal() [1/2]

static decimal QuantConnect.Util.StreamReaderExtensions.GetDecimal ( this StreamReader  stream,
char  delimiter = DefaultDelimiter 
)
static

Gets a decimal from the provided stream reader

Parameters
streamThe data stream
delimiterThe data delimiter character to use, default is ','
Returns
The decimal read from the stream

Definition at line 44 of file StreamReaderExtensions.cs.

◆ GetDecimal() [2/2]

static decimal QuantConnect.Util.StreamReaderExtensions.GetDecimal ( this StreamReader  stream,
out bool  pastEndLine,
char  delimiter = DefaultDelimiter 
)
static

Gets a decimal from the provided stream reader

Parameters
streamThe data stream
delimiterThe data delimiter character to use, default is ','
pastEndLineTrue if end line was past, useful for consumers to know a line ended
Returns
The decimal read from the stream

Definition at line 57 of file StreamReaderExtensions.cs.

◆ GetDateTime()

static DateTime QuantConnect.Util.StreamReaderExtensions.GetDateTime ( this StreamReader  stream,
string  format = DateFormat.TwelveCharacter,
char  delimiter = DefaultDelimiter 
)
static

Gets a date time instance from a stream reader

Parameters
streamThe data stream
formatThe format in which the date time is
delimiterThe data delimiter character to use, default is ','
Returns
The date time instance read

Definition at line 106 of file StreamReaderExtensions.cs.

◆ GetInt32()

static int QuantConnect.Util.StreamReaderExtensions.GetInt32 ( this StreamReader  stream,
char  delimiter = DefaultDelimiter 
)
static

Gets an integer from a stream reader

Parameters
streamThe data stream
delimiterThe data delimiter character to use, default is ','
Returns
The integer instance read

Definition at line 135 of file StreamReaderExtensions.cs.

◆ GetString()

static string QuantConnect.Util.StreamReaderExtensions.GetString ( this StreamReader  stream,
char  delimiter = DefaultDelimiter 
)
static

Gets a string from a stream reader

Parameters
streamThe data stream
delimiterThe data delimiter character to use, default is ','
Returns
The string instance read

Definition at line 168 of file StreamReaderExtensions.cs.


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