diff --git a/build/vc2015/nana.vcxproj b/build/vc2015/nana.vcxproj index e9c0aa02..ce428ef7 100644 --- a/build/vc2015/nana.vcxproj +++ b/build/vc2015/nana.vcxproj @@ -249,6 +249,9 @@ + + + diff --git a/build/vc2015/nana.vcxproj.filters b/build/vc2015/nana.vcxproj.filters index 0f547b4e..aaac3c60 100644 --- a/build/vc2015/nana.vcxproj.filters +++ b/build/vc2015/nana.vcxproj.filters @@ -49,6 +49,9 @@ {53feb93f-2b86-4bf5-b2f3-f60ef1bbbf76} + + {6caffbf6-c023-4dbf-ba69-cdb49feddb5d} + @@ -280,4 +283,9 @@ Source Files\gui\detail + + + Header Files\filesystem + + \ No newline at end of file diff --git a/include/nana/filesystem/filesystem_selector.hpp b/include/nana/filesystem/filesystem_selector.hpp new file mode 100644 index 00000000..6b26b5d5 --- /dev/null +++ b/include/nana/filesystem/filesystem_selector.hpp @@ -0,0 +1,81 @@ +/** +* Nana C++ Library(http://www.nanapro.org) +* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) +* +* Distributed under the Boost Software License, Version 1.0. +* (See accompanying file LICENSE_1_0.txt or copy at +* http://www.boost.org/LICENSE_1_0.txt) +* +* @file nana\filesystem\filesystem_selector.hpp +* @autor by Ariel Vina-Rodriguez: +* @brief A "ISO C++" filesystem Implementation selector +* The ISO C++ File System Technical Specification is optional. +* http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf +* This is not a workaround, but an user option. +* The library maybe available in the std library in use or from Boost (almost compatible) +* http://www.boost.org/doc/libs/1_60_0/libs/filesystem/doc/index.htm +* or you can choose to use the (partial, but functional) implementation provided by nana. +* If you include the file +* The selected option will be set by nana into std::experimental::filesystem +* By default Nana will use the ISO TS if available, or nana if not. +* Boost will be use only if explicitily changed +* nana Now mimic std::experimental::filesystem::v1 (boost v3) +* +*/ + +#ifndef NANA_FILESYSTEM_SELECTOR +#define NANA_FILESYSTEM_SELECTOR + +#include + +#if defined(NANA_BOOST_FILESYSTEM_AVAILABLE) && ( defined(NANA_BOOST_FILESYSTEM_FORCE) || (defined(STD_FILESYSTEM_NOT_SUPPORTED) && defined(NANA_BOOST_FILESYSTEM_PREFERRED) ) ) + +# include + // add boost::filesystem into std::experimental::filesystem + namespace std { + namespace experimental { +# ifdef CXX_NO_INLINE_NAMESPACE + using namespace boost::experimental; +# else + using namespace boost::experimental::v3; +# endif + + } + +#elif defined(STD_FILESYSTEM_NOT_SUPPORTED) + +# include + namespace std { + namespace experimental { +# ifdef CXX_NO_INLINE_NAMESPACE + using namespace nana::experimental; +# else + using namespace nana::experimental::v1; +# endif + } +} + +#else +# include +#endif + +#ifndef __cpp_lib_experimental_filesystem +# define __cpp_lib_experimental_filesystem 1 +#endif + +#if defined(NANA_WINDOWS) +constexpr auto def_root = "C:"; +constexpr auto def_rootstr = "C:\\"; +constexpr auto def_rootname = "Local Drive(C:)"; +#elif defined(NANA_LINUX) +constexpr auto def_root = "/"; +constexpr auto def_rootstr = "/"; +constexpr auto def_rootname = "Root/"; +#endif + +#endif // NANA_FILESYSTEM_SELECTOR // "Force use of Boost filesystem if available (over ISO)? + + + + +