returns if file1 should come before file2
| 59 | |
| 60 | //returns if file1 should come before file2 |
| 61 | bool FolderData::compareFileName(const FileData* file1, const FileData* file2) |
| 62 | { |
| 63 | std::string name1 = file1->getName(); |
| 64 | std::string name2 = file2->getName(); |
| 65 | |
| 66 | //min of name1/name2 .length()s |
| 67 | unsigned int count = name1.length() > name2.length() ? name2.length() : name1.length(); |
| 68 | for(unsigned int i = 0; i < count; i++) |
| 69 | { |
| 70 | if(toupper(name1[i]) != toupper(name2[i])) |
| 71 | { |
| 72 | return toupper(name1[i]) < toupper(name2[i]); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | return name1.length() < name2.length(); |
| 77 | } |
| 78 | |
| 79 | bool FolderData::compareRating(const FileData* file1, const FileData* file2) |
| 80 | { |