Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:53:57

0001 /*
0002  * Distributed under the Boost Software License, Version 1.0.(See accompanying 
0003  * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
0004  * 
0005  * See http://www.boost.org/libs/iostreams for documentation.
0006 
0007  * File:        boost/iostreams/detail/execute.hpp
0008  * Date:        Thu Dec 06 13:21:54 MST 2007
0009  * Copyright:   2007-2008 CodeRage, LLC
0010  * Author:      Jonathan Turkanis
0011  * Contact:     turkanis at coderage dot com
0012  *
0013  * Defines the function boost::iostreams::detail::absolute_path, used for 
0014  * debug output for mapped files.
0015  */
0016 
0017 #ifndef BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED
0018 #define BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED
0019 
0020 #include <string>
0021 #include <boost/iostreams/detail/config/windows_posix.hpp>
0022 #ifdef BOOST_IOSTREAMS_WINDOWS
0023 # include <cctype>
0024 #endif
0025 #include <boost/iostreams/detail/current_directory.hpp>
0026 
0027 namespace boost { namespace iostreams { namespace detail {
0028 
0029 // Resolves the given path relative to the current working directory
0030 inline std::string absolute_path(const std::string& path)
0031 {
0032 #ifdef BOOST_IOSTREAMS_WINDOWS
0033     return path.size() && (path[0] == '/' || path[0] == '\\') ||
0034            path.size() > 1 && std::isalpha(path[0]) && path[1] == ':' ?
0035                path :
0036                current_directory() + '\\' + path;
0037 #else // #ifdef BOOST_IOSTREAMS_WINDOWS
0038     return path.size() && (path[0] == '/') ?
0039         path :
0040         current_directory() + '/' + path;
0041 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS
0042 }
0043 
0044 } } } // End namespaces detail, iostreams, boost.
0045 
0046 #endif // #ifndef BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED