Ticket #2543: path_hpp_boost_135.patch

File path_hpp_boost_135.patch, 7.5 KB (added by christian.leutloff@…, 14 years ago)
  • path.hpp

    old new  
    691691      template<class Path>
    692692      inline  bool is_separator( typename Path::string_type::value_type c )
    693693      {
    694         return c == slash<Path>::value
     694        return c == (typename Path::string_type::value_type) slash<Path>::value
    695695#     ifdef BOOST_WINDOWS_PATH
    696696          || c == path_alt_separator<Path>::value
    697697#     endif
     
    711711
    712712        // case: "//"
    713713        if ( end_pos == 2
    714           && str[0] == slash<path_type>::value
    715           && str[1] == slash<path_type>::value ) return 0;
     714          && str[0] == (typename String::value_type) slash<path_type>::value
     715          && str[1] == (typename String::value_type) slash<path_type>::value ) return 0;
    716716
    717717        // case: ends in "/"
    718         if ( end_pos && str[end_pos-1] == slash<path_type>::value )
     718        if ( end_pos && str[end_pos-1] == (typename String::value_type) slash<path_type>::value )
    719719          return end_pos-1;
    720720       
    721721        // set pos to start of last element
     
    729729#       endif
    730730
    731731        return ( pos == String::npos // path itself must be a leaf (or empty)
    732           || (pos == 1 && str[0] == slash<path_type>::value) ) // or net
     732          || (pos == 1 && str[0] == (typename String::value_type) slash<path_type>::value) ) // or net
    733733            ? 0 // so leaf is entire string
    734734            : pos + 1; // or starts after delimiter
    735735      }
     
    760760        typename String::size_type cur(0);
    761761       
    762762        // deal with // [network]
    763         if ( size >= 2 && src[0] == slash<path_type>::value
    764           && src[1] == slash<path_type>::value
     763        if ( size >= 2 && src[0] == (typename String::value_type) slash<path_type>::value
     764          && src[1] == (typename String::value_type) slash<path_type>::value
    765765          && (size == 2
    766             || src[2] != slash<path_type>::value) )
     766            || src[2] != (typename String::value_type) slash<path_type>::value) )
    767767        {
    768768          cur += 2;
    769769          element_size += 2;
    770770        }
    771771
    772772        // leading (not non-network) separator
    773         else if ( src[0] == slash<path_type>::value )
     773        else if ( src[0] == (typename String::value_type) slash<path_type>::value )
    774774        {
    775775          ++element_size;
    776776          // bypass extra leading separators
    777777          while ( cur+1 < size
    778             && src[cur+1] == slash<path_type>::value )
     778            && src[cur+1] == (typename String::value_type) slash<path_type>::value )
    779779          {
    780780            ++cur;
    781781            ++element_pos;
     
    789789        // find the end
    790790        while ( cur < size
    791791#         ifdef BOOST_WINDOWS_PATH
    792           && src[cur] != colon<path_type>::value
     792          && src[cur] != (typename String::value_type) colon<path_type>::value
    793793#         endif
    794           && src[cur] != slash<path_type>::value )
     794          && src[cur] != (typename String::value_type) slash<path_type>::value )
    795795        {
    796796          ++cur;
    797797          ++element_size;
     
    800800#       ifdef BOOST_WINDOWS_PATH
    801801        if ( cur == size ) return;
    802802        // include device delimiter
    803         if ( src[cur] == colon<path_type>::value )
     803        if ( src[cur] == (typename String::value_type) colon<path_type>::value )
    804804          { ++element_size; }
    805805#       endif
    806806
     
    820820#     ifdef BOOST_WINDOWS_PATH
    821821        // case "c:/"
    822822        if ( size > 2
    823           && s[1] == colon<path_type>::value
    824           && s[2] == slash<path_type>::value ) return 2;
     823          && s[1] == (typename String::value_type) colon<path_type>::value
     824          && s[2] == (typename String::value_type) slash<path_type>::value ) return 2;
    825825#     endif
    826826
    827827        // case "//"
    828828        if ( size == 2
    829           && s[0] == slash<path_type>::value
    830           && s[1] == slash<path_type>::value ) return String::npos;
     829          && s[0] == (typename String::value_type) slash<path_type>::value
     830          && s[1] == (typename String::value_type) slash<path_type>::value ) return String::npos;
    831831
    832832        // case "//net {/}"
    833833        if ( size > 3
    834           && s[0] == slash<path_type>::value
    835           && s[1] == slash<path_type>::value
    836           && s[2] != slash<path_type>::value )
     834          && s[0] == (typename String::value_type) slash<path_type>::value
     835          && s[1] == (typename String::value_type) slash<path_type>::value
     836          && s[2] != (typename String::value_type) slash<path_type>::value )
    837837        {
    838838          typename String::size_type pos(
    839839            s.find( slash<path_type>::value, 2 ) );
     
    841841        }
    842842       
    843843        // case "/"
    844         if ( size > 0 && s[0] == slash<path_type>::value ) return 0;
     844        if ( size > 0 && s[0] == (typename String::value_type) slash<path_type>::value ) return 0;
    845845
    846846        return String::npos;
    847847      }
     
    895895        detail::leaf_pos<String, Traits>( m_path, m_path.size() ) );
    896896
    897897      bool leaf_was_separator( m_path.size()
    898         && m_path[end_pos] == slash<path_type>::value );
     898        && m_path[end_pos] == (typename String::value_type) slash<path_type>::value );
    899899
    900900      // skip separators unless root directory
    901901      typename string_type::size_type root_dir_pos( detail::root_directory_start
     
    903903      for ( ;
    904904        end_pos > 0
    905905        && (end_pos-1) != root_dir_pos
    906         && m_path[end_pos-1] == slash<path_type>::value
     906        && m_path[end_pos-1] == (typename String::value_type) slash<path_type>::value
    907907        ;
    908908        --end_pos ) {}
    909909
     
    920920          && (itr.m_name[0] == slash<path_type>::value
    921921#     ifdef BOOST_WINDOWS_PATH
    922922          || itr.m_name[itr.m_name.size()-1]
    923             == colon<path_type>::value
     923            == (typename String::value_type) colon<path_type>::value
    924924#     endif
    925925             ); ++itr ) {}
    926926
     
    935935      return ( itr.m_pos != m_path.size()
    936936        && (
    937937            ( itr.m_name.size() > 1
    938               && itr.m_name[0] == slash<path_type>::value
    939               && itr.m_name[1] == slash<path_type>::value
     938              && itr.m_name[0] == (typename string_type::value_type) slash<path_type>::value
     939              && itr.m_name[1] == (typename string_type::value_type) slash<path_type>::value
    940940            )
    941941#     ifdef BOOST_WINDOWS_PATH
    942942          || itr.m_name[itr.m_name.size()-1]
    943             == colon<path_type>::value
     943            == (typename string_type::value_type) colon<path_type>::value
    944944#     endif
    945945           ) )
    946946        ? *itr
     
    10031003    {
    10041004      if (
    10051005#       ifdef BOOST_WINDOWS_PATH
    1006         *(m_path.end()-1) != colon<path_type>::value &&
     1006        *(m_path.end()-1) != (typename string_type::value_type) colon<path_type>::value &&
    10071007#       endif
    1008         *(m_path.end()-1) != slash<path_type>::value )
     1008        *(m_path.end()-1) != (typename string_type::value_type) slash<path_type>::value )
    10091009      {
    10101010        m_path += slash<path_type>::value;
    10111011      }
     
    10351035      ( const value_type * next_p )
    10361036    {
    10371037      // ignore escape sequence on POSIX or Windows
    1038       if ( *next_p == slash<path_type>::value
    1039         && *(next_p+1) == slash<path_type>::value
    1040         && *(next_p+2) == colon<path_type>::value ) next_p += 3;
     1038      if ( *next_p == (typename string_type::value_type) slash<path_type>::value
     1039        && *(next_p+1) == (typename string_type::value_type) slash<path_type>::value
     1040        && *(next_p+2) == (typename string_type::value_type) colon<path_type>::value ) next_p += 3;
    10411041     
    10421042      // append slash<path_type>::value if needed
    10431043      if ( !empty() && *next_p != 0