parse<T> expands the given string and evaluats defined operators.
Currently only the range operator is defined and used.
417 {
418 auto out = std::stringstream();
419 auto iss = std::istringstream(rLine);
420 auto token = std::string();
421
422 if (!std::getline(iss, token, delim))
423 return std::string();
424
425 if (std::search(token.begin(), token.end(), m_gRangeOperator.begin(),
426 m_gRangeOperator.end()) != token.end()) {
427 StringToVector::expand<T>(out, delim, token);
428 } else {
429 out << token;
430 }
431
432
433 while (std::getline(iss, token, delim))
434 try {
435 if (std::search(token.begin(), token.end(), m_gRangeOperator.begin(),
436 m_gRangeOperator.end()) != token.end()) {
437 out << ',';
438 StringToVector::expand<T>(out, delim, token);
439 } else {
440 out << delim << token;
441 }
442 } catch (const std::invalid_argument& rErr) {
443 throw std::runtime_error("Invalid token, got:'" + token + "'! " +
444 rErr.what());
445 } catch (const std::out_of_range& rErr) {
446
447 throw std::runtime_error("Conversion out of range, got: '" + token +
448 "'! " + rErr.what());
449 }
450 return out.str();
451 }