Class to parse a string of comma separated range delimiters. Note: It only works for unsigned integers.
More...
#include <RangeParser.hpp>
|
| RangeParser (const std::string &rawRange_) |
| Constructor from a string, it will parse the string automatically.
|
|
std::vector< int > | getRange () const |
| Get the range in the form of a vector of integers.
|
|
std::vector< int > | atomicRangeToRange (const std::string &atomicRange) |
| Parse individual range atoms. For example this method will map "2" into std::vector<int>{2} and "2-3" into std::vector<int>{2,3}.
|
|
void | parse () |
| Main parser method, it will parse a comma separated string of range delimiters.
|
|
Class to parse a string of comma separated range delimiters. Note: It only works for unsigned integers.
◆ RangeParser()
sisi4s::RangeParser::RangeParser |
( |
const std::string & |
rawRange_ | ) |
|
|
inline |
Constructor from a string, it will parse the string automatically.
◆ atomicRangeToRange()
std::vector< int > sisi4s::RangeParser::atomicRangeToRange |
( |
const std::string & |
atomicRange | ) |
|
|
inline |
Parse individual range atoms. For example this method will map "2" into std::vector<int>{2} and "2-3" into std::vector<int>{2,3}.
◆ getRange()
std::vector< int > sisi4s::RangeParser::getRange |
( |
| ) |
const |
|
inline |
Get the range in the form of a vector of integers.
◆ parse()
void sisi4s::RangeParser::parse |
( |
| ) |
|
|
inline |
Main parser method, it will parse a comma separated string of range delimiters.
E.g. it will turn "2 ,3 , 4, 8-10" into {2,3,4,8,9,10}. Note that it is supposed to be whitespace safe.
◆ parsedRange
std::vector<int> sisi4s::RangeParser::parsedRange |
|
protected |
◆ rawRange
const std::string sisi4s::RangeParser::rawRange |
|
protected |
The documentation for this class was generated from the following file: