13#include "MantidKernel/DllConfig.h"
22namespace MultiFileNameParsing {
40 bool operator()(
const std::string &a,
const std::string &b)
const;
70 void parse(
const std::string &multiFileName);
73 std::vector<std::vector<unsigned int>>
runs()
const {
return m_runs; }
75 std::vector<std::vector<std::string>>
fileNames()
const {
return m_fileNames; }
77 std::string
dirString()
const {
return m_dirString; }
83 std::string
runString()
const {
return m_runString; }
85 std::string
extString()
const {
return m_extString; }
88 std::vector<std::vector<unsigned int>> parseMultiRunString(std::string runString);
90 bool trimWhiteSpaces()
const;
92 void setTrimWhiteSpaces(
const bool &setting);
101 std::vector<std::vector<unsigned int>>
m_runs;
107 std::string
m_dirString, m_instString, m_underscoreString, m_runString, m_extString;
122 GenerateFileName(std::string prefix, std::string suffix, std::string instString);
126 std::vector<std::string> operator()(
const std::vector<unsigned int> &runs);
128 std::string operator()(
unsigned int run);
153 std::set<std::pair<unsigned int, unsigned int>>
rangeList()
const {
return m_rangeList; };
156 void addRun(
const unsigned int run);
158 void addRunRange(
const unsigned int from,
const unsigned int to);
160 void addRunRange(
const std::pair<unsigned int, unsigned int> &range);
A functor that generates a vector of file names from the given vector of runs, and other state passed...
std::string m_instString
String that identifies the instrument.
std::string m_prefix
String that prefixes any generated file names.
std::string m_suffix
String that suffixes any generated file names.
This class takes a string representing multiple files and parses it into a vector of vectors of file ...
std::string runString() const
Return the parsed run string.
std::vector< std::vector< unsigned int > > runs() const
Return the vector of vectors of parsed file names.
std::string underscoreString() const
Return the parsed underscore string.
std::string m_multiFileName
The given string to parse.
std::vector< std::vector< std::string > > m_fileNames
A vector of vectors of the parsed file names.
std::string instString() const
Return the parsed instrument string.
std::vector< std::vector< unsigned int > > m_runs
A vector of vectors of the parsed runs.
std::set< std::string, ReverseCaselessCompare > m_validInstNames
All the valid instrument names.
~Parser()=default
Destructor.
bool m_trimWhiteSpaces
Flag to determine if string input should be trimmed of whitespace.
std::string dirString() const
Return the parsed directory string.
std::string extString() const
Return the parsed extension string.
std::string m_dirString
The various sections of the given string to parse.
std::vector< std::vector< std::string > > fileNames() const
Return the vector of vectors of parsed file names.
Comparator for set that holds instrument names in Parser.
A class that holds a list of ranges of runs.
std::set< std::pair< unsigned int, unsigned int > > m_rangeList
A set of pairs of unsigned ints, where each pair represents a range of runs.
std::set< std::pair< unsigned int, unsigned int > > rangeList() const
void split(const int A, int &S, int &V)
Split a number into the sign and positive value.
const std::string ADD_STEP_RANGE
const std::string ADD_RANGE
const std::string ADD_LIST
const std::string UNDERSCORE
const std::string STEP_RANGE
MANTID_KERNEL_DLL std::string suggestWorkspaceName(const std::vector< std::string > &fileNames)
Suggests a workspace name, given a vector of file names.
Helper class which provides the Collimation Length for SANS instruments.