Example #1
0
    bool file::operator<( const file &other ) const
    {
        if( sorting == by_size )
        return size() < other.size();

        if( sorting == by_date )
        return date() < other.date();

        if( sorting == by_extension ) //@todo: lower!, buggy
        return ext() < other.ext();

        if( sorting == by_type )
        return is_dir() < other.is_dir();

        //if( sorting == by_name )
        return pathfile < other.pathfile;
    }
Example #2
0
    bool file::operator==( const file &other ) const
    {
        if( sorting == by_size )
        return size() == other.size();

        if( sorting == by_date )
        return date() == other.date();

        if( sorting == by_extension )
        return ext() == other.ext();

        if( sorting == by_type )
        return is_dir() == other.is_dir();

        //if( sorting == by_name )
        return pathfile == other.pathfile;
    }