.. _program_listing_file_src_navtk_fs_filesystem.hpp: Program Listing for File filesystem.hpp ======================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/navtk/fs/filesystem.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once // This file allows for a filesystem to be robustly included across multiple environments. #ifdef NAVTK_STD_HAS_FILESYSTEM_HEADER # include #elif defined(NAVTK_STD_EXPERIMENTAL_FILESYSTEM_HEADER) # include #elif defined(__has_include) && __has_include("filesystem") # include #else # include #endif #ifdef NAVTK_STD_FILESYSTEM_NAMESPACE // When NAVTK_STD_FILESYSTEM_NAMESPACE is defined, it should contain the namespace your compiler // uses for the filesystem library. If you don't know, the #else below is a generic fallback that // should work on most compilers. namespace navtk { namespace fs = NAVTK_STD_FILESYSTEM_NAMESPACE; } #else // This works by creating a new `navtk::fs` namespace (rather than aliasing an existing namespace), // and just populating that namespace with the contents of other namespaces that might exist // depending on how filesystem is implemented in your libc++. Because the system libraries won't // provide all of them, we declare the std namespaces we intend to try here ourselves before // referencing them in the usings. namespace std { namespace filesystem {} namespace experimental { namespace filesystem {} } // namespace experimental namespace __fs { namespace filesystem {} } // namespace __fs } // namespace std namespace navtk { namespace fs { using namespace ::std::experimental::filesystem; using namespace ::std::__fs::filesystem; using namespace ::std::filesystem; } // namespace fs } // namespace navtk #endif