Ticket #2543: path_hpp_boost_135.patch
File path_hpp_boost_135.patch, 7.5 KB (added by , 14 years ago) |
---|
-
path.hpp
old new 691 691 template<class Path> 692 692 inline bool is_separator( typename Path::string_type::value_type c ) 693 693 { 694 return c == slash<Path>::value694 return c == (typename Path::string_type::value_type) slash<Path>::value 695 695 # ifdef BOOST_WINDOWS_PATH 696 696 || c == path_alt_separator<Path>::value 697 697 # endif … … 711 711 712 712 // case: "//" 713 713 if ( end_pos == 2 714 && str[0] == slash<path_type>::value715 && 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; 716 716 717 717 // 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 ) 719 719 return end_pos-1; 720 720 721 721 // set pos to start of last element … … 729 729 # endif 730 730 731 731 return ( pos == String::npos // path itself must be a leaf (or empty) 732 || (pos == 1 && str[0] == slash<path_type>::value) ) // or net732 || (pos == 1 && str[0] == (typename String::value_type) slash<path_type>::value) ) // or net 733 733 ? 0 // so leaf is entire string 734 734 : pos + 1; // or starts after delimiter 735 735 } … … 760 760 typename String::size_type cur(0); 761 761 762 762 // deal with // [network] 763 if ( size >= 2 && src[0] == slash<path_type>::value764 && src[1] == slash<path_type>::value763 if ( size >= 2 && src[0] == (typename String::value_type) slash<path_type>::value 764 && src[1] == (typename String::value_type) slash<path_type>::value 765 765 && (size == 2 766 || src[2] != slash<path_type>::value) )766 || src[2] != (typename String::value_type) slash<path_type>::value) ) 767 767 { 768 768 cur += 2; 769 769 element_size += 2; 770 770 } 771 771 772 772 // 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 ) 774 774 { 775 775 ++element_size; 776 776 // bypass extra leading separators 777 777 while ( cur+1 < size 778 && src[cur+1] == slash<path_type>::value )778 && src[cur+1] == (typename String::value_type) slash<path_type>::value ) 779 779 { 780 780 ++cur; 781 781 ++element_pos; … … 789 789 // find the end 790 790 while ( cur < size 791 791 # ifdef BOOST_WINDOWS_PATH 792 && src[cur] != colon<path_type>::value792 && src[cur] != (typename String::value_type) colon<path_type>::value 793 793 # endif 794 && src[cur] != slash<path_type>::value )794 && src[cur] != (typename String::value_type) slash<path_type>::value ) 795 795 { 796 796 ++cur; 797 797 ++element_size; … … 800 800 # ifdef BOOST_WINDOWS_PATH 801 801 if ( cur == size ) return; 802 802 // include device delimiter 803 if ( src[cur] == colon<path_type>::value )803 if ( src[cur] == (typename String::value_type) colon<path_type>::value ) 804 804 { ++element_size; } 805 805 # endif 806 806 … … 820 820 # ifdef BOOST_WINDOWS_PATH 821 821 // case "c:/" 822 822 if ( size > 2 823 && s[1] == colon<path_type>::value824 && 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; 825 825 # endif 826 826 827 827 // case "//" 828 828 if ( size == 2 829 && s[0] == slash<path_type>::value830 && 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; 831 831 832 832 // case "//net {/}" 833 833 if ( size > 3 834 && s[0] == slash<path_type>::value835 && s[1] == slash<path_type>::value836 && 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 ) 837 837 { 838 838 typename String::size_type pos( 839 839 s.find( slash<path_type>::value, 2 ) ); … … 841 841 } 842 842 843 843 // 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; 845 845 846 846 return String::npos; 847 847 } … … 895 895 detail::leaf_pos<String, Traits>( m_path, m_path.size() ) ); 896 896 897 897 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 ); 899 899 900 900 // skip separators unless root directory 901 901 typename string_type::size_type root_dir_pos( detail::root_directory_start … … 903 903 for ( ; 904 904 end_pos > 0 905 905 && (end_pos-1) != root_dir_pos 906 && m_path[end_pos-1] == slash<path_type>::value906 && m_path[end_pos-1] == (typename String::value_type) slash<path_type>::value 907 907 ; 908 908 --end_pos ) {} 909 909 … … 920 920 && (itr.m_name[0] == slash<path_type>::value 921 921 # ifdef BOOST_WINDOWS_PATH 922 922 || itr.m_name[itr.m_name.size()-1] 923 == colon<path_type>::value923 == (typename String::value_type) colon<path_type>::value 924 924 # endif 925 925 ); ++itr ) {} 926 926 … … 935 935 return ( itr.m_pos != m_path.size() 936 936 && ( 937 937 ( itr.m_name.size() > 1 938 && itr.m_name[0] == slash<path_type>::value939 && itr.m_name[1] == slash<path_type>::value938 && 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 940 940 ) 941 941 # ifdef BOOST_WINDOWS_PATH 942 942 || itr.m_name[itr.m_name.size()-1] 943 == colon<path_type>::value943 == (typename string_type::value_type) colon<path_type>::value 944 944 # endif 945 945 ) ) 946 946 ? *itr … … 1003 1003 { 1004 1004 if ( 1005 1005 # 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 && 1007 1007 # endif 1008 *(m_path.end()-1) != slash<path_type>::value )1008 *(m_path.end()-1) != (typename string_type::value_type) slash<path_type>::value ) 1009 1009 { 1010 1010 m_path += slash<path_type>::value; 1011 1011 } … … 1035 1035 ( const value_type * next_p ) 1036 1036 { 1037 1037 // ignore escape sequence on POSIX or Windows 1038 if ( *next_p == slash<path_type>::value1039 && *(next_p+1) == slash<path_type>::value1040 && *(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; 1041 1041 1042 1042 // append slash<path_type>::value if needed 1043 1043 if ( !empty() && *next_p != 0