Sequoia
Loading...
Searching...
No Matches
FileSystemUtilities.hpp
Go to the documentation of this file.
1
2// Copyright Oliver J. Rosten 2020. //
3// Distributed under the GNU GENERAL PUBLIC LICENSE, Version 3.0. //
4// (See accompanying file LICENSE.md or copy at //
5// https://www.gnu.org/licenses/gpl-3.0.en.html) //
7
8#pragma once
9
15
16#include <filesystem>
17
18namespace sequoia::testing
19{
20 template<>
21 struct serializer<std::filesystem::path>
22 {
23 [[nodiscard]]
24 static std::string make(const std::filesystem::path& p);
25 };
26
27 template<>
28 struct serializer<std::filesystem::file_type>
29 {
30 [[nodiscard]]
31 static std::string make(const std::filesystem::file_type& val);
32 };
33
34 void throw_unless_exists(const std::filesystem::path& p, std::string_view message="");
35
36 void throw_unless_directory(const std::filesystem::path& p, std::string_view message="");
37
38 void throw_unless_regular_file(const std::filesystem::path& p, std::string_view message="");
39
40 [[nodiscard]]
41 std::filesystem::path find_in_tree(const std::filesystem::path& root, const std::filesystem::path& toFind);
42
43 [[nodiscard]]
44 std::filesystem::path rebase_from(const std::filesystem::path& filename, const std::filesystem::path& dir);
45}
Core declarations / definitions used in the testing framework.
Specialize this struct template to provide custom serialization of a given class. .
Definition: CoreInfrastructure.hpp:28