MCPcopy Create free account
hub / github.com/Stewmath/GameYob / nameSortFunction

Function nameSortFunction

arm9/source/filechooser.cpp:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52int nameSortFunction(char*& a, char*& b)
53{
54 // ".." sorts before everything except itself.
55 bool aIsParent = strcmp(a, "..") == 0;
56 bool bIsParent = strcmp(b, "..") == 0;
57
58 if (aIsParent && bIsParent)
59 return 0;
60 else if (aIsParent) // Sorts before
61 return -1;
62 else if (bIsParent) // Sorts after
63 return 1;
64 else
65 return strcasecmp(a, b);
66}
67
68/*
69 * Determines whether a portion of a vector is sorted.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected