lintel 0.2.0
Loading...
Searching...
No Matches
FileServiceFileExists.h
Go to the documentation of this file.
1#pragma once
2
3#include <exception>
4#include <filesystem>
5#include <format>
6
7namespace lintel {
9class FileServiceFileExists : public std::exception
10{
11private:
12 const std::filesystem::path m_path;
13 const std::string m_message;
14
15public:
17 explicit FileServiceFileExists(const std::filesystem::path &path)
18 : m_path(path), m_message(std::format("No Operation possible bc. {} exists", path.string()))
19 {}
20
21 [[nodiscard]] const char *what() const noexcept override { return m_message.c_str(); }
22
24 [[nodiscard]] const std::filesystem::path &getPath() const { return m_path; }
25};
26}// namespace lintel
Definition FileServiceFileExists.h:10
const char * what() const noexcept override
Definition FileServiceFileExists.h:21
const std::filesystem::path & getPath() const
Definition FileServiceFileExists.h:24
FileServiceFileExists(const std::filesystem::path &path)
Definition FileServiceFileExists.h:17
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9