Skip to content

Commit

Permalink
Amendments to fix compiler errors on non-win7 builds. Refs #1419
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterParker committed Nov 25, 2011
1 parent 2abcf36 commit 859e741
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
Expand Up @@ -10,6 +10,8 @@

#include <vector>
#include <string>
#include <map>
#include <utility>

namespace Mantid
{
Expand Down Expand Up @@ -52,9 +54,9 @@ namespace Kernel
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/

typedef std::map<std::vector<unsigned int>, std::string> VectOfUInt2StringMap;
typedef std::pair<std::vector<unsigned int>, std::string> VectOfUInt2StringPair;
typedef std::map<std::vector<std::string>, std::string> VectOfStrings2StringMap;
// typedef std::map<std::vector<unsigned int>, std::string> VectOfUInt2StringMap;
// typedef std::pair<std::vector<unsigned int>, std::string> VectOfUInt2StringPair;
// typedef std::map<std::vector<std::string>, std::string> VectOfStrings2StringMap;

class MANTID_KERNEL_DLL MultiFileNameParser
{
Expand All @@ -67,7 +69,7 @@ namespace Kernel
/// Parse the multiFileNameString. Returns error if failed, "" if successful.
std::string parse(const std::string & multiFileName);
/// Returns the result of a call to parse.
VectOfStrings2StringMap getFileNamesToWsNameMap() const;
std::map<std::vector<std::string>, std::string> getFileNamesToWsNameMap() const;

/// Regexs
static const std::string INST;
Expand All @@ -93,7 +95,7 @@ namespace Kernel
/// Does an initial split of the multiFileName string.
void split();
/// Appends run numbers and corresponding wsNames to final map.
void populateMap(const VectOfUInt2StringPair & pair);
void populateMap(const std::pair<std::vector<unsigned int>, std::string> & pair);
/// Creates a file name from the given run and currently parsed info
/// about file type, etc.
std::string createFileName(unsigned int run);
Expand All @@ -106,7 +108,7 @@ namespace Kernel
std::string m_multiFileName;
std::string m_dir, m_inst, m_runs, m_ext;

VectOfStrings2StringMap m_fileNamesToWsNameMap;
std::map<std::vector<std::string>, std::string> m_fileNamesToWsNameMap;
UserStringParser m_parser;
};
}
Expand Down
15 changes: 10 additions & 5 deletions Code/Mantid/Framework/Kernel/src/MultiFileNameParser.cpp
Expand Up @@ -12,6 +12,7 @@
#include <boost/tokenizer.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>

#include <Poco/Path.h>

Expand Down Expand Up @@ -56,7 +57,7 @@ namespace Mantid
std::string operator()(std::vector<unsigned int> run)
{
if(run.size() != 1)
throw std::exception("An unexpected run number was found during parsing.");
throw std::exception::exception("An unexpected run number was found during parsing.");

return boost::lexical_cast<std::string>(run.at(0));
}
Expand All @@ -73,7 +74,10 @@ namespace Mantid
*/
struct parseRunRange
{
VectOfUInt2StringMap & operator()(VectOfUInt2StringMap & parsedRuns, const std::string & runString)
std::map<std::vector<unsigned int>, std::string> & operator()(
std::map<std::vector<unsigned int>,
std::string> & parsedRuns,
const std::string & runString)
{
// Regex to separate non-added runs from the added runs.
boost::regex regex("(" +
Expand Down Expand Up @@ -174,7 +178,7 @@ namespace Mantid
// Do some further tokenising of the tokens where necessary, and parse into
// a UIntVect2StringMap which maps vectors of unsigned int run numbers to
// the eventual workspace name of that vector of runs.
VectOfUInt2StringMap runUIntsToWsNameMap;
std::map<std::vector<unsigned int>, std::string> runUIntsToWsNameMap;
runUIntsToWsNameMap = std::accumulate(
tokens.begin(), tokens.end(),
runUIntsToWsNameMap,
Expand Down Expand Up @@ -203,7 +207,7 @@ namespace Mantid
*
* @returns the map
*/
VectOfStrings2StringMap MultiFileNameParser::getFileNamesToWsNameMap() const
std::map<std::vector<std::string>, std::string> MultiFileNameParser::getFileNamesToWsNameMap() const
{
return m_fileNamesToWsNameMap;
}
Expand Down Expand Up @@ -255,7 +259,8 @@ namespace Mantid
*
* @param pair - a std::pair consisting of a vector of run numbers and a ws name
*/
void MultiFileNameParser::populateMap(const VectOfUInt2StringPair & pair)
void MultiFileNameParser::populateMap(
const std::pair<std::vector<unsigned int>, std::string> & pair)
{
// Convert vector of run numbers to vector of filenames
std::vector<unsigned int> runs = pair.first;
Expand Down

0 comments on commit 859e741

Please sign in to comment.