Skip to content

Commit

Permalink
Use a more sensible argument type for FileFinder::findRun
Browse files Browse the repository at this point in the history
Refs #7994
  • Loading branch information
martyngigg committed Sep 30, 2013
1 parent 888194f commit 4866c32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions Code/Mantid/Framework/API/inc/MantidAPI/FileFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ namespace Mantid
{
public:
std::string getFullPath(const std::string& filename)const;
std::string getPath(const std::vector<IArchiveSearch_sptr>& archs, const std::set<std::string>& filename, const std::vector<std::string>& extensions)const;
std::string getPath(const std::vector<IArchiveSearch_sptr>& archs, const std::set<std::string>& filename,
const std::vector<std::string>& extensions)const;
/// DO NOT USE! MADE PUBLIC FOR TESTING ONLY.
std::string makeFileName(const std::string& hint, const Kernel::InstrumentInfo& instrument)const;
void setCaseSensitive(const bool cs);
bool getCaseSensitive() const;
std::string findRun(const std::string& hintstr,const std::set<std::string> *exts)const;
std::string findRun(const std::string& hintstr,const std::vector<std::string> &exts = std::vector<std::string>())const;
std::string findRun(const std::string& hintstr,const std::set<std::string> & exts)const;
std::string findRun(const std::string& hintstr,
const std::vector<std::string> &exts = std::vector<std::string>())const;
std::vector<std::string> findRuns(const std::string& hintstr)const;
/// DO NOT USE! MADE PUBLIC FOR TESTING ONLY.
const Kernel::InstrumentInfo getInstrument(const std::string& hint) const;
Expand Down
8 changes: 4 additions & 4 deletions Code/Mantid/Framework/API/src/FileFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,15 @@ namespace Mantid
* this argument is ignored.
* @return The full path to the file or empty string if not found
*/
std::string FileFinderImpl::findRun(const std::string& hintstr, const std::set<std::string> *exts) const
std::string FileFinderImpl::findRun(const std::string& hintstr, const std::set<std::string> &exts) const
{
std::string hint = Kernel::Strings::strip(hintstr);
g_log.debug() << "set findRun(\'" << hintstr << "\', exts[" << exts->size() << "])\n";
g_log.debug() << "set findRun(\'" << hintstr << "\', exts[" << exts.size() << "])\n";
if (hint.empty())
return "";
std::vector<std::string> exts_v;
if (exts != NULL && exts->size() > 0)
exts_v.assign(exts->begin(), exts->end());
if (!exts.empty())
exts_v.assign(exts.begin(), exts.end());

return this->findRun(hint, exts_v);
}
Expand Down

0 comments on commit 4866c32

Please sign in to comment.