- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Search for |

# path_leaf.hpp

Go to the documentation of this file.

    00001 //  Copyright (c) 2005-2009 Hartmut Kaiser
    00002 //
    00003 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
    00004 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    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