Mantid
|
Class responsible for finding a specifications on disk. More...
#include <SampleEnvironmentFactory.h>
Public Member Functions | |
SampleEnvironmentSpec_uptr | find (const std::string &facility, const std::string &instrument, const std::string &name) const override |
Find a named specification in a file. More... | |
SampleEnvironmentSpec_uptr | parseSpec (const std::string &name, const std::string &filename) const override |
Parses the specification from the given file. More... | |
SampleEnvironmentSpecFileFinder (std::vector< std::string > directories) | |
Constructor accepting a list of directories to search. More... | |
Public Member Functions inherited from Mantid::DataHandling::ISampleEnvironmentSpecFinder | |
virtual SampleEnvironmentSpec_uptr | find (const std::string &facility, const std::string &instrument, const std::string &name) const =0 |
virtual SampleEnvironmentSpec_uptr | parseSpec (const std::string &name, const std::string &filename) const =0 |
virtual | ~ISampleEnvironmentSpecFinder ()=default |
Private Attributes | |
const std::string | m_fileext = ".xml" |
const std::vector< std::string > | m_rootDirs |
Class responsible for finding a specifications on disk.
Definition at line 58 of file SampleEnvironmentFactory.h.
Mantid::DataHandling::SampleEnvironmentSpecFileFinder::SampleEnvironmentSpecFileFinder | ( | std::vector< std::string > | directories | ) |
Constructor accepting a list of directories to search.
directories | A list of directories that form the root of the search path. Each entry will be appended with /facility/instrument/ and this directory then forms the path to find the named spec |
std::invalid_argument | if the list is empty |
Definition at line 127 of file SampleEnvironmentFactory.cpp.
References m_rootDirs.
|
overridevirtual |
Find a named specification in a file.
facility | Name of facility |
instrument | Full name of the instrument |
name | The name of the spec |
Implements Mantid::DataHandling::ISampleEnvironmentSpecFinder.
Definition at line 141 of file SampleEnvironmentFactory.cpp.
References Mantid::Kernel::Logger::debug(), Mantid::API::g_log, m_fileext, m_rootDirs, and parseSpec().
|
overridevirtual |
Parses the specification from the given file.
name | The name of the specification |
filename | Assumed to be an absolute path to an existing specification |
Implements Mantid::DataHandling::ISampleEnvironmentSpecFinder.
Definition at line 182 of file SampleEnvironmentFactory.cpp.
References Mantid::DataHandling::SampleEnvironmentSpecParser::parse().
Referenced by find().
|
private |
Definition at line 67 of file SampleEnvironmentFactory.h.
Referenced by find().
|
private |
Definition at line 68 of file SampleEnvironmentFactory.h.
Referenced by find(), and SampleEnvironmentSpecFileFinder().