Skip to content
Snippets Groups Projects
Commit 7be32455 authored by Sofia Antony's avatar Sofia Antony
Browse files

re#2155- fix for build failures

parent 80638cfc
No related merge requests found
......@@ -5,8 +5,7 @@
// Includes
//----------------------------------------------------------------------
#include "MantidKernel/DLLExport.h"
#include "MantidKernel/System.h"
#include "MantidKernel/DllExport.h"
#include <boost/tokenizer.hpp>
#include <boost/shared_ptr.hpp>
......@@ -58,12 +57,12 @@ namespace Kernel
//destructor
~UserStringParser();
/// parses a given string into a vector of vector of numbers
std::vector<std::vector<unsigned int>> parse(const std::string& userString);
std::vector<std::vector<unsigned int> > parse(const std::string& userString);
private:
///separate a given string to a vector of comma separated strings
std::vector<std::string> separateComma (const std::string&);
/// separates a given string to vector of vector of numbers using colon as the delimeter
std::vector<std::vector<unsigned int>> separateColon(const std::string& input);
std::vector<std::vector<unsigned int> > separateColon(const std::string& input);
///separate delimiter string from input string and return a vector of numbers created from the separated string
std::vector<unsigned int> separateDelimiters(const std::string& input,const std::string& symbol);
......@@ -76,7 +75,7 @@ namespace Kernel
void Tokenize(const std::string& input,const std::string& separator,unsigned int& start, unsigned int& end,unsigned int& step);
/// convert the string into numbers
void convertToNumbers(const std::string& userString,std::vector<std::vector<unsigned int>>& numbers);
void convertToNumbers(const std::string& userString,std::vector<std::vector<unsigned int> >& numbers);
};
......
......@@ -21,9 +21,9 @@ namespace Mantid
*@param userString - the string to parse
*@returns a vector containing vectors of numbers.
*/
std::vector<std::vector<unsigned int>> UserStringParser::parse(const std::string& userString)
std::vector<std::vector<unsigned int> > UserStringParser::parse(const std::string& userString)
{
std::vector<std::vector<unsigned int>> numbers;
std::vector<std::vector<unsigned int> > numbers;
//first separate commas
std::vector<std::string> commaseparatedstrings;
if(userString.find(",")!=std::string::npos)
......@@ -54,7 +54,7 @@ namespace Mantid
*@param numbers- a vector containing vectors of numbers.
*/
void UserStringParser::convertToNumbers(const std::string& userString,
std::vector<std::vector<unsigned int>>& numbers)
std::vector<std::vector<unsigned int> >& numbers)
{
//look for separators
......@@ -83,8 +83,8 @@ namespace Mantid
}
else if (Contains(userString,':'))
{
std::vector<std::vector<unsigned int>>colonseparated= separateColon(userString);
std::vector<std::vector<unsigned int>>::const_iterator citr1;
std::vector<std::vector<unsigned int> >colonseparated= separateColon(userString);
std::vector<std::vector<unsigned int> >::const_iterator citr1;
for(citr1=colonseparated.begin();citr1!=colonseparated.end();++citr1)
{
numbers.push_back((*citr1));
......@@ -94,9 +94,9 @@ namespace Mantid
}
/** This method checks input string contains character ch
* @input - the input string
* @input - character ch to search
* @return - true if the string contains character ch.
* @param input - the input string
* @param ch - character ch to search
* @returns - true if the string contains character ch.
*/
bool UserStringParser::Contains(const std::string& input,char ch)
{
......@@ -111,7 +111,7 @@ namespace Mantid
std::vector<std::string> UserStringParser::separateComma(const std::string& input)
{
typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> commasep(",");
std::vector<std::string> commaseparatedvalues;
......@@ -128,12 +128,12 @@ namespace Mantid
*@param input - the string to parse
*@returns a vector of vector containing colon separated tokens.
*/
std::vector<std::vector<unsigned int>> UserStringParser::separateColon(const std::string& input)
std::vector<std::vector<unsigned int> > UserStringParser::separateColon(const std::string& input)
{
unsigned int startNum=0;
unsigned int endNum=0;
unsigned int step=1;
std::vector<std::vector<unsigned int>> separatedValues;
std::vector<std::vector<unsigned int> > separatedValues;
Tokenize(input,":",startNum,endNum,step);
for(unsigned int num=startNum;num<=endNum;num+=step)
{
......@@ -177,7 +177,7 @@ namespace Mantid
void UserStringParser::Tokenize(const std::string& input,const std::string& delimiter,
unsigned int& start, unsigned int& end,unsigned int& step)
{
typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> seps(delimiter.c_str());
std::vector<unsigned int> separatedValues;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment