Mantid
Loading...
Searching...
No Matches
FileResource.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
14#pragma once
15
16#include <boost/filesystem.hpp>
17#include <iostream>
18#include <string>
19
21
22public:
23 FileResource(const std::string &fileName, bool debugMode = false);
24 void setDebugMode(bool mode);
25 std::string fullPath() const;
27
28private:
30 boost::filesystem::path m_full_path; // full path to file
31 // prevent heap allocation for ScopedFileHandle
32protected:
33 static void *operator new(std::size_t); // prevent heap allocation of scalar.
34 static void *operator new[](std::size_t); // prevent heap allocation of array.
35};
RAII: Gives a clean file destination and removes the file when handle is out of scope.
Definition: FileResource.h:20
void setDebugMode(bool mode)
std::string fullPath() const
bool m_debugMode
Definition: FileResource.h:29
boost::filesystem::path m_full_path
Definition: FileResource.h:30