src/core/http_router.hpp
inline std::string
    path_cat(
        boost::beast::string_view base,
        boost::beast::string_view path)
    {
        if(base.empty())
            return path.to_string();
        std::string result = base.to_string();
    #if BOOST_MSVC
        char constexpr path_separator = '\\';
        if(result.back() == path_separator)
            result.resize(result.size() - 1);
        result.append(path.data(), path.size());
        for(auto& c : result)
            if(c == '/')
                c = path_separator;
    #else
        char constexpr path_separator = '/';
        if(result.back() == path_separator)
            result.resize(result.size() - 1);
        result.append(path.data(), path.size());
    #endif
        return result;
    }
// Append an HTTP rel-path to a local filesystem path.
// The returned path is normalized for the platform.
Append an HTTP rel-path to a local filesystem path.
The returned path is normalized for the platform.
Append an HTTP rel - path to a local filesystem path . The returned path is normalized for the platform .
inline std::string
    path_cat(
        boost::beast::string_view base,
        boost::beast::string_view path)
    {
        if(base.empty())
            return path.to_string();
        std::string result = base.to_string();
    #if BOOST_MSVC
        char constexpr path_separator = '\\';
        if(result.back() == path_separator)
            result.resize(result.size() - 1);
        result.append(path.data(), path.size());
        for(auto& c : result)
            if(c == '/')
                c = path_separator;
    #else
        char constexpr path_separator = '/';
        if(result.back() == path_separator)
            result.resize(result.size() - 1);
        result.append(path.data(), path.size());
    #endif
        return result;
    }
inline std :: string path_cat ( boost :: beast :: string_view base , boost :: beast :: string_view path ) { if ( base . empty ( ) ) return path . to_string ( ) ; std :: string result = base . to_string ( ) ; #if BOOST_MSVC char constexpr path_separator = ' \\ ' ; if ( result . back ( ) == path_separator ) result . resize ( result . size ( ) - 1 ) ; result . append ( path . data ( ) , path . size ( ) ) ; for ( auto & c : result ) if ( c == ' ' ) c = path_separator ; #else char constexpr path_separator = ' ' ; if ( result . back ( ) == path_separator ) result . resize ( result . size ( ) - 1 ) ; result . append ( path . data ( ) , path . size ( ) ) ; #endif return result ; }
Append an HTTP rel-path to a local filesystem path.
Append an HTTP rel - path to a local filesystem path .