Mantid
Loading...
Searching...
No Matches
Static Public Member Functions | Private Types | Private Member Functions | List of all members
Mantid::DataHandling::GroupDetectors2::RangeHelper Class Reference

provides a function that expands pairs of integers separated with a hyphen into a list of all the integers between those values More...

Static Public Member Functions

static void getList (const std::string &line, std::vector< size_t > &outList)
 Expands any ranges in the input string of non-negative integers, eg. More...
 

Private Types

enum  { IGNORE_SPACES }
 give an enum from poco a better name here More...
 

Private Member Functions

 RangeHelper ()=default
 this class can't be constructed it is just a holder for some static things More...
 

Detailed Description

provides a function that expands pairs of integers separated with a hyphen into a list of all the integers between those values

Definition at line 118 of file GroupDetectors2.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

give an enum from poco a better name here

Enumerator
IGNORE_SPACES 

equal to

Definition at line 127 of file GroupDetectors2.h.

Constructor & Destructor Documentation

◆ RangeHelper()

Mantid::DataHandling::GroupDetectors2::RangeHelper::RangeHelper ( )
privatedefault

this class can't be constructed it is just a holder for some static things

References Mantid::Kernel::StringTokenizer::TOK_IGNORE_EMPTY, and Mantid::Kernel::StringTokenizer::TOK_TRIM.

Member Function Documentation

◆ getList()

void Mantid::DataHandling::GroupDetectors2::RangeHelper::getList ( const std::string &  line,
std::vector< size_t > &  outList 
)
static

Expands any ranges in the input string of non-negative integers, eg.

"1 3-5 4" -> "1 3 4 5 4"

Parameters
line:: a line of input that is interpreted and expanded
outList:: all integers specified both as ranges and individually in order
Exceptions
invalid_argumentif a character is found that is not an integer or hypehn and when a hyphen occurs at the start or the end of the line

Definition at line 1070 of file GroupDetectors2.cpp.

References Mantid::Kernel::StringTokenizer::begin(), Mantid::Kernel::StringTokenizer::count(), Mantid::Kernel::StringTokenizer::end(), and IGNORE_SPACES.

Referenced by Mantid::DataHandling::GroupDetectors2::readSpectraIndexes().


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