00001
00002
00003
00004
00005
00006 #ifndef SAGA_SAGA_PATH_LEAF_HPP
00007 #define SAGA_SAGA_PATH_LEAF_HPP
00008
00009 #include <string>
00010 #include <boost/version.hpp>
00011 #include <boost/filesystem/path.hpp>
00012
00013 namespace saga { namespace detail
00014 {
00015
00016 inline SAGA_EXPORT std::string leaf(boost::filesystem::path const& p)
00017 {
00018 #if BOOST_VERSION >= 103600
00019 return p.empty() ? std::string() : *--p.end();
00020 #else
00021 return p.leaf();
00022 #endif
00023 }
00024
00025 }}
00026
00027 #endif
00028