MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / compareFileName

Method compareFileName

src/FolderData.cpp:61–77  ·  view source on GitHub ↗

returns if file1 should come before file2

Source from the content-addressed store, hash-verified

59
60//returns if file1 should come before file2
61bool 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
79bool FolderData::compareRating(const FileData* file1, const FileData* file2)
80{

Callers

nothing calls this directly

Calls 1

getNameMethod · 0.80

Tested by

no test coverage detected