src/ThriftHTTPWSServer.cc
// 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 .
std::string path_cat(const boost::beast::string_view base,
                     const boost::beast::string_view path) {
    if (base.empty()) {
        return std::string(path);
    }
    std::string result(base);
#ifdef 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;
}
std :: string path_cat ( const boost :: beast :: string_view base , const boost :: beast :: string_view path ) { if ( base . empty ( ) ) { return std :: string ( path ) ; } std :: string result ( base ) ; #ifdef 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 .