File indexing completed on 2025-12-15 09:53:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
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
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
0038 return path.size() && (path[0] == '/') ?
0039 path :
0040 current_directory() + '/' + path;
0041 #endif
0042 }
0043
0044 } } }
0045
0046 #endif