** Function name: sortList ** Description: sort files/folders by name ***************************************************************************************/
| 227 | ** Description: sort files/folders by name |
| 228 | ***************************************************************************************/ |
| 229 | bool sortList(const Option &a, const Option &b) { |
| 230 | const uint16_t _folderColor = uint16_t(FGCOLOR - 0x1111); |
| 231 | bool _a = (a.color == _folderColor); // is folder |
| 232 | bool _b = (b.color == _folderColor); // is folder |
| 233 | if (_a != _b) { |
| 234 | return _a > _b; // true if a is a folder and b is not |
| 235 | } |
| 236 | // Order items alphabetically |
| 237 | String fa = a.label; |
| 238 | fa.toUpperCase(); |
| 239 | String fb = b.label; |
| 240 | fb.toUpperCase(); |
| 241 | return fa < fb; |
| 242 | } |
| 243 | |
| 244 | /*************************************************************************************** |
| 245 | ** Function name: readFs |
nothing calls this directly
no outgoing calls
no test coverage detected