Chris@16: /* Chris@16: * Distributed under the Boost Software License, Version 1.0.(See accompanying Chris@16: * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) Chris@16: * Chris@16: * See http://www.boost.org/libs/iostreams for documentation. Chris@16: Chris@16: * File: boost/iostreams/detail/execute.hpp Chris@16: * Date: Thu Dec 06 13:21:54 MST 2007 Chris@16: * Copyright: 2007-2008 CodeRage, LLC Chris@16: * Author: Jonathan Turkanis Chris@16: * Contact: turkanis at coderage dot com Chris@16: * Chris@16: * Defines the function boost::iostreams::detail::absolute_path, used for Chris@16: * debug output for mapped files. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED Chris@16: #define BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED Chris@16: Chris@16: #include Chris@16: #include Chris@16: #ifdef BOOST_IOSTREAMS_WINDOWS Chris@16: # include Chris@16: #endif Chris@16: #include Chris@16: Chris@16: namespace boost { namespace iostreams { namespace detail { Chris@16: Chris@16: // Resolves the given path relative to the current working directory Chris@16: inline std::string absolute_path(const std::string& path) Chris@16: { Chris@16: #ifdef BOOST_IOSTREAMS_WINDOWS Chris@16: return path.size() && (path[0] == '/' || path[0] == '\\') || Chris@16: path.size() > 1 && std::isalpha(path[0]) && path[1] == ':' ? Chris@16: path : Chris@16: current_directory() + '\\' + path; Chris@16: #else // #ifdef BOOST_IOSTREAMS_WINDOWS Chris@16: return path.size() && (path[0] == '/') ? Chris@16: path : Chris@16: current_directory() + '/' + path; Chris@16: #endif // #ifdef BOOST_IOSTREAMS_WINDOWS Chris@16: } Chris@16: Chris@16: } } } // End namespaces detail, iostreams, boost. Chris@16: Chris@16: #endif // #ifndef BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED