| #include "src/impl.h" |
| |
| namespace mp4v2 { namespace impl { |
| |
| /////////////////////////////////////////////////////////////////////////////// |
| |
| bool |
| LessIgnoreCase::operator()( const std::string& xstr, const std::string& ystr ) const |
| { |
| const std::string::size_type xlen = xstr.length(); |
| const std::string::size_type ylen = ystr.length(); |
| |
| if( xlen < ylen ) { |
| for( std::string::size_type i = 0; i < xlen; i++ ) { |
| const char x = std::toupper( xstr[i] ); |
| const char y = std::toupper( ystr[i] ); |
| |
| if( x < y ) |
| return true; |
| else if ( x > y ) |
| return false; |
| } |
| return true; |
| } |
| else { |
| for( std::string::size_type i = 0; i < ylen; i++ ) { |
| const char x = std::toupper( xstr[i] ); |
| const char y = std::toupper( ystr[i] ); |
| |
| if( x < y ) |
| return true; |
| else if ( x > y ) |
| return false; |
| } |
| return false; |
| } |
| } |
| |
| /////////////////////////////////////////////////////////////////////////////// |
| |
| }} // namespace mp4v2::impl |