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 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).
|
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.
◆ 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
-
| symbols | The coma-separated list of symbols. |
- Returns
- The created set of parsed candle symbols
◆ parseCandleSymbols() [2/2]
Parses an input string and returns a set of candle symbols.
- Parameters
-
| symbols | The coma-separated list of symbols. |
- Returns
- The created set of parsed candle symbols
◆ parseEventSources()
Parses the input string and returns a wrapped set of event sources (EventSourceWrapper).
The input string should look like comma-separated: "name1,name2".
- Parameters
-
| sources | The input source names. |
- Returns
- The set of sources or wrapped IndexedEventSource::DEFAULT if sources is empty.
- Exceptions
-
◆ 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
-
| properties | The 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
-
| properties | The 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
-
| symbols | The coma-separated list of symbols. |
- Returns
- The created set of parsed symbols
◆ parseSymbols() [2/2]
Parses an input string and returns a set of symbols.
The symbol "all" or "*" can be passed. This will add WildcardSymbol (all symbols).
- Parameters
-
| symbols | The coma-separated list of symbols. |
- Returns
- The created set of parsed symbols
◆ parseSymbolsAndSaveOrder()
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
-
| symbols | The 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
-
| types | The 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
-
| types | The comma-separated list of event types. |
- Returns
- The created pair: set of parsed types and vector unknown types.
Referenced by parseTypes().