Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
error_file.h
1#ifndef SOURCEMETA_CORE_ERROR_FILE_H_
2#define SOURCEMETA_CORE_ERROR_FILE_H_
3
4#include <filesystem> // std::filesystem::path
5#include <utility> // std::move, std::forward
6
7namespace sourcemeta::core {
8
19template <typename T> class FileError : public T {
20public:
23 template <typename... Args>
24 FileError(std::filesystem::path path, Args &&...args)
25 : T{std::forward<Args>(args)...}, path_{std::move(path)} {}
26
28 [[nodiscard]] auto path() const noexcept -> const std::filesystem::path & {
29 return this->path_;
30 }
31
32private:
33 std::filesystem::path path_;
34};
35
36} // namespace sourcemeta::core
37
38#endif
FileError(std::filesystem::path path, Args &&...args)
Definition error_file.h:24
auto path() const noexcept -> const std::filesystem::path &
The offending file path.
Definition error_file.h:28