Mantid
Loading...
Searching...
No Matches
LoadSingleMesh.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8
9namespace Mantid::DataHandling {
10
11LoadSingleMesh::LoadSingleMesh(std::string filename, std::ios_base::openmode mode, ScaleUnits scaleType)
12 : MeshFileIO(scaleType), m_filename(std::move(filename)), m_file(std::ifstream(m_filename.c_str(), mode)) {
13 if (!m_file) {
14 g_log.error("Unable to open file: " + m_filename);
15 throw Kernel::Exception::FileError("Unable to open file: ", m_filename);
16 }
17}
18
20
21} // namespace Mantid::DataHandling
LoadSingleMesh(std::string filename, std::ios_base::openmode mode, ScaleUnits scaleType)
Records the filename and the description of failure.
Definition: Exception.h:98
void error(const std::string &msg)
Logs at error level.
Definition: Logger.cpp:77
Kernel::Logger g_log("ExperimentInfo")
static logger object
STL namespace.