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
00017
00019 inline SAGA_EXPORT std::string leaf(boost::filesystem::path const& p)
00020 {
00021 #if BOOST_VERSION >= 103600
00022 return p.empty() ? std::string() : *--p.end();
00023 #else
00024 return p.leaf();
00025 #endif
00026 }
00027
00028 }}
00029
00030 #endif
00031