dxFeed Graal CXX API v9.0.0
Loading...
Searching...
No Matches
CmdArgsUtils Struct Referencefinal

Parsers of the command line style arguments: lists of symbols, candle symbols, event types, event sources and properties, as the samples and tools accept them. More...

#include <CmdArgsUtils.hpp>

Static Public Member Functions

static std::unordered_set< SymbolWrapper > parseSymbols (StringParam symbols)
 Parses an input string and returns a set of symbols.
template<typename S>
static std::unordered_set< SymbolWrapper > parseSymbols (const std::optional< S > &symbols)
 Parses an input string and returns a set of symbols.
static std::vector< SymbolWrapper > parseSymbolsAndSaveOrder (StringParam symbols)
 Parses an input string and returns a vector of symbols in the same order.
static std::unordered_set< CandleSymbol > parseCandleSymbols (StringParam symbols)
 Parses an input string and returns a set of candle symbols.
template<typename S>
static std::unordered_set< CandleSymbol > parseCandleSymbols (const std::optional< S > &symbols)
 Parses an input string and returns a set of candle symbols.
static std::pair< std::unordered_set< std::reference_wrapper< const EventTypeEnum > >, std::vector< std::string > > parseTypes (StringParam types)
 Parses an input string and returns a set of event types.
template<typename S>
static std::pair< std::unordered_set< std::reference_wrapper< const EventTypeEnum > >, std::vector< std::string > > parseTypes (const std::optional< S > &types)
 Parses an input string and returns a set of event types.
static std::unordered_map< std::string, std::string > parseProperties (StringParam properties) noexcept
 Parses the input string and returns a collection of key-value properties.
template<typename S>
static std::unordered_map< std::string, std::string > parseProperties (const std::optional< S > &properties) noexcept
 Parses the input string and returns a collection of key-value properties.
static std::unordered_set< EventSourceWrapper > parseEventSources (StringParam sources)
 Parses the input string and returns a wrapped set of event sources (EventSourceWrapper).

Detailed Description

Parsers of the command line style arguments: lists of symbols, candle symbols, event types, event sources and properties, as the samples and tools accept them.

Member Function Documentation

◆ parseCandleSymbols() [1/2]

template<typename S>
std::unordered_set< CandleSymbol > CmdArgsUtils::parseCandleSymbols ( const std::optional< S > & symbols)
inlinestatic

Parses an input string and returns a set of candle symbols.

Parameters
symbolsThe coma-separated list of symbols.
Returns
The created set of parsed candle symbols

◆ parseCandleSymbols() [2/2]

std::unordered_set< CandleSymbol > CmdArgsUtils::parseCandleSymbols ( StringParam symbols)
static

Parses an input string and returns a set of candle symbols.

Parameters
symbolsThe coma-separated list of symbols.
Returns
The created set of parsed candle symbols

◆ parseEventSources()

std::unordered_set< EventSourceWrapper > CmdArgsUtils::parseEventSources ( StringParam sources)
static

Parses the input string and returns a wrapped set of event sources (EventSourceWrapper).

The input string should look like comma-separated: "name1,name2".

Parameters
sourcesThe input source names.
Returns
The set of sources or wrapped IndexedEventSource::DEFAULT if sources is empty.
Exceptions
InvalidArgumentExceptionif a source name is not valid.

◆ parseProperties() [1/2]

template<typename S>
std::unordered_map< std::string, std::string > CmdArgsUtils::parseProperties ( const std::optional< S > & properties)
inlinestaticnoexcept

Parses the input string and returns a collection of key-value properties.

The input string should look like comma-separated: "key=value".

Parameters
propertiesThe input comma-separated key-value pairs.
Returns
The collection of key-value properties.

◆ parseProperties() [2/2]

std::unordered_map< std::string, std::string > CmdArgsUtils::parseProperties ( StringParam properties)
staticnoexcept

Parses the input string and returns a collection of key-value properties.

The input string should look like comma-separated: "key=value".

Parameters
propertiesThe input comma-separated key-value pairs.
Returns
The collection of key-value properties.

◆ parseSymbols() [1/2]

template<typename S>
std::unordered_set< SymbolWrapper > CmdArgsUtils::parseSymbols ( const std::optional< S > & symbols)
inlinestatic

Parses an input string and returns a set of symbols.

The symbol "all" or "*" can be passed. This will add WildcardSymbol (all symbols).

Parameters
symbolsThe coma-separated list of symbols.
Returns
The created set of parsed symbols

◆ parseSymbols() [2/2]

std::unordered_set< SymbolWrapper > CmdArgsUtils::parseSymbols ( StringParam symbols)
static

Parses an input string and returns a set of symbols.

The symbol "all" or "*" can be passed. This will add WildcardSymbol (all symbols).

Parameters
symbolsThe coma-separated list of symbols.
Returns
The created set of parsed symbols

◆ parseSymbolsAndSaveOrder()

std::vector< SymbolWrapper > CmdArgsUtils::parseSymbolsAndSaveOrder ( StringParam symbols)
static

Parses an input string and returns a vector of symbols in the same order.

The symbol "all" or "*" can be passed. This will add WildcardSymbol (all symbols).

Parameters
symbolsThe coma-separated list of symbols.
Returns
The created vector of parsed symbols

◆ parseTypes() [1/2]

template<typename S>
std::pair< std::unordered_set< std::reference_wrapper< const EventTypeEnum > >, std::vector< std::string > > CmdArgsUtils::parseTypes ( const std::optional< S > & types)
inlinestatic

Parses an input string and returns a set of event types.

"all" or "*" will be converted to all types.

Parameters
typesThe comma-separated list of event types.
Returns
The created pair of set of parsed types and vector unknown types.

References parseTypes().

◆ parseTypes() [2/2]

std::pair< std::unordered_set< std::reference_wrapper< const EventTypeEnum > >, std::vector< std::string > > CmdArgsUtils::parseTypes ( StringParam types)
static

Parses an input string and returns a set of event types.

"all" or "*" will be converted to all types.

Parameters
typesThe comma-separated list of event types.
Returns
The created pair: set of parsed types and vector unknown types.

Referenced by parseTypes().