supereight
filesystem.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2020-2023 Smart Robotics Lab, Imperial College London, Technical University of Munich
3  * SPDX-FileCopyrightText: 2020-2023 Nils Funk
4  * SPDX-FileCopyrightText: 2020-2023 Sotiris Papatheodorou
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 // Detect std::filesystem support, include the appropriate header and alias the
9 // namespace.
10 
11 #ifndef __FILESYSTEM_HPP
12 #define __FILESYSTEM_HPP
13 
14 #if __has_include(<filesystem>)
15 # include <filesystem>
16 namespace stdfs = std::filesystem;
17 
18 #elif __has_include(<experimental/filesystem>)
19 # include <experimental/filesystem>
20 namespace stdfs = std::experimental::filesystem;
21 
22 #else
23 // No std::filesystem support.
24 # error A compiler with support for std::filesystem is required
25 #endif
26 
27 #endif // __FILESYSTEM_HPP